REBOOT(2) — UNIX Programmer’s Manual
NAME
reboot − reboot system or halt processor
SYNOPSIS
#include <sys/reboot.h>
reboot(howto)
int howto;
DESCRIPTION
Reboot reboots the system, and is invoked automatically in the event of unrecoverable system failures. Howto is a mask of options passed to the bootstrap program. The system call interface permits only RB_HALT or RB_AUTOBOOT to be passed to the reboot program. When none of these options (e.g. RB_AUTOBOOT) is given, the system is rebooted according to the SCEDMON parameters. An automatic consistency check of the disks is then normally performed.
The bits of howto 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.
RB_SINGLE
Normally, the reboot procedure involves an automatic disk consistency check and then multi-user operations. RB_SINGLE prevents the consistency check, rather simply booting the system with a single-user shell on the console. RB_SINGLE is interpreted by the init(8) program in the newly booted system. This switch is not available from the system call interface.
Only the super-user may reboot a machine.
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.
[EINVAL] The currently executing processor is not the only online processor in the system; see tmp_ctl(2).
SEE ALSO
tmp_ctl(2), halt(8), init(8), reboot(8)
4BSD/DYNIX