reboot - reboot or enable/disable Ctrl-Alt-Del
#include <unistd.h> #include <linux/reboot.h>
int reboot (int magic, int magic2, int flag, void *arg);
#include <unistd.h> #include <sys/reboot.h>
int reboot (int flag);
The reboot call reboots the system, or enables/disables the reboot keystroke (abbreviated CAD, since the default is Ctrl-Alt-Delete; it can be changed using loadkeys(1)).
This system call will fail (with EINVAL) unless magic equals LINUX_REBOOT_MAGIC1 (that is, 0xfee1dead) and magic2 equals LINUX_REBOOT_MAGIC2 (that is, 672274793). However, since 2.1.17 also LINUX_REBOOT_MAGIC2A (that is, 85072278) and since 2.1.97 also LINUX_REBOOT_MAGIC2B (that is, 369367448) are permitted as value for magic2. (The hexadecimal values of these constants are meaningful.) The flag argument can have the following values:
:LINUX_REBOOT_CMD_CAD_ON: (RB_ENABLE_CAD, 0x89abcdef). CAD is enabled. This means that the CAD keystroke will immediately cause the action associated to LINUX_REBOOT_CMD_RESTART.
Only the super-user may use this function.
The precise effect of the above actions depends on the architecture. For the i386 architecture, the additional argument does not do anything at present (2.1.122), but the type of reboot can be determined by kernel command line arguments (`reboot=...') to be either warm or cold, and either hard or through the BIOS.
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
reboot(2) is Linux specific, and should not be used in programs intended to be portable.
sync(2), bootparam(7), ctrlaltdel(8)?, halt(8), reboot(8)
3 pages link to reboot(2):