reboot(3B)
NAME
reboot − reboot system or halt processor
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <sys/reboot.h>
int reboot ( howto, bootargs)
int howto;
char ∗bootargs;
DESCRIPTION
reboot() reboots the system. howto is a mask of options passed to the bootstrap program. The function interface permits only RB_HALT or RB_AUTOBOOT to be passed to the reboot program; the other flags are used in scripts stored on the console storage media, or used in manual bootstrap procedures. When none of these options (for instance RB_AUTOBOOT ) is given, the system is rebooted from file /kernel/unix. An automatic consistency check of the disks is then normally performed.
The bits of howto that are used are:
RB_HALT the processor is simply halted; no reboot takes place. RB_HALT should be used with caution.
RB_ASKNAME
Interpreted by the bootstrap program itself, causing it to inquire as to what file should be booted. Normally, the system is booted from the file /kernel/unix without asking.
bootargs is an obsolete pointer that is now ignored, even though reboot() still requires a second argument of type char ∗ .
RETURN VALUES
If successful, this call never returns. Otherwise, a −1 is returned and an error is returned in the global variable errno.
ERRORS
EPERM The caller is not the super-user.
FILES
/kernel/unix system namelist
SEE ALSO
intro(1M), crash(1M), halt(1M), init(1M), reboot(1M), uadmin(2)
NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-thread applications is unsupported.
Any other howto argument causes /kernel/unix to boot.
Only the super-user may reboot() a machine.
bootargs is ignored in SunOS 5.X releases.
SunOS 5.4 — Last change: 22 Jan 1993