GNU/Linux |
RedHat 5.2(Apollo) |
|
![]() |
reboot(2) |
![]() |
reboot − reboot or disable Ctrl-Alt-Del
#include <unistd.h>
int reboot (int magic, int magic_too, int flag);
reboot reboots the system, or enables/disables the Ctrl-Alt-Delete (CAD) reboot keystroke.
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, and should not be used in programs intended to be portable.
sync(2), ctrlaltdel(8), halt(8), reboot(8)
![]() |
reboot(2) | ![]() |