sys_reboot  [kernel/sys.c]


Reboots the system, or enables/disables the reboot keystroke (Ctrl-Alt-Delete).

Arguments

eax 88
ebx 1st Magic value - LINUX_REBOOT_MAGIC1. If this argument is not set to this value the system call will fail with -EINVAL.
Both this value and 2nd magic value are implemented only as precaution from rebooting the whole system by mistake.
ecx 2nd Magic value. It maybe one of the following: LINUX_REBOOT_MAGIC2, LINUX_REBOOT_MAGIC2A, LINUX_REBOOT_MAGIC2B, or LINUX_REBOOT_MAGIC2C.
edx Command to perform. It may be one of the following:
LINUX_REBOOT_CMD_RESTART The message 'Restarting system.' is printed, and a default restart is performed immediately. If not preceded by a sys_sync, data will be lost.
esi is ignored.
LINUX_REBOOT_CMD_HALT The message `System halted.' is printed, and the system is halted. Control is given to the ROM monitor, if there is one. If not preceded by a sys_sync, data will be lost.
esi is ignored.
LINUX_REBOOT_CMD_CAD_ON CAD (Ctrl-Alt-Delete) is enabled. This means that the CAD keystroke will immediately cause the action associated with LINUX_REBOOT_CMD_RESTART.
esi is ignored.
LINUX_REBOOT_CMD_CAD_OFF CAD is disabled. This means that the CAD keystroke will cause a SIGINT signal to be sent to init (process 1), whereupon this process may decide upon a proper action (maybe: kill all processes, sync, reboot).
esi is ignored.
LINUX_REBOOT_CMD_POWER_OFF The message 'Power down.' is printed, the system is stopped, and all power is removed from the system, if possible. If not preceded by a sys_sync, data will be lost.
esi is ignored.
LINUX_REBOOT_CMD_RESTART2 The message 'Restarting system with command '%s'' is printed, and a restart (using the command string pointed by esi) is performed immediately. If not preceded by a sys_sync, data will be lost.
LINUX_REBOOT_CMD_SW_SUSPEND Suspend system using software suspend if it is supported by the kernel.
esi is ignored.
LINUX_REBOOT_CMD_KEXEC Restart system using a previously loaded Linux kernel.
esi is ignored.
esi This argument depends on the command used. See above.

Return values

If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:

-EFAULT Problem with getting userspace data under LINUX_REBOOT_CMD_RESTART2.
-EINVAL Bad magic numbers or command.
-EPERM The calling process has insufficient privilege to call sys_reboot; the CAP_SYS_BOOT capability is required.

Remarks

n/a

Compatibility

n/a