Table of Contentsreboot - reboot or disable Cntrl-Alt-Del #include <unistd.h> int reboot (int magic, int magic_too, int flag);
reboot reboots the system, or enables/disables CAD. If magic == 0xfee1dead && magictoo == 672274793, then the action performed will be based on flag.
If flag = 0x1234567, then a hard reset is performed.
If flag = 0x89abcdef, then CAD is enabled.
If flag = 0, then CAD is disabled and a signal is sent to process ID 1.
Note that reboot() does not sync()!
Only the super-user may use this function.
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. - EINVAL
- Bad magic numbers or flag.
- EPERM
- A non-root user attempts to call reboot.
reboot is Linux specific. sync(2), ctrlaltdel(8), halt(8), reboot(8)
Table of Contents
www.fiveanddime.net