Copyright (C) 2000-2012 |
Manpages REBOOTSection: Linux Programmer's Manual (2)Updated: 1998-09-24 Index Return to Main Contents NAMEreboot - reboot or enable/disable Ctrl-Alt-DelSYNOPSISFor libc4 and libc5 the library call and the system call are identical, and since kernel version 2.1.30 there are symbolic names LINUX_REBOOT_* for the constants and a fourth argument to the call:
#include <unistd.h>
int reboot (int magic, int magic2, int flag, void *arg); Under glibc some of the constants involved have gotten symbolic names RB_*, and the library call is a 1-argument wrapper around the 3-argument system call:
#include <unistd.h>
DESCRIPTIONThe 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:
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. RETURN VALUEOn success, zero is returned. On error, -1 is returned, and errno is set appropriately.ERRORS
CONFORMING TOreboot is Linux specific, and should not be used in programs intended to be portable.SEE ALSOsync(2), bootparam(7), ctrlaltdel(8), halt(8), reboot(8)
IndexThis document was created by man2html, using the manual pages. Time: 16:51:25 GMT, April 26, 2024 |