Add copyright
[unix-history] / usr / src / lib / libc / sys / reboot.2
CommitLineData
7b826f9e
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
ab9465ad 5.\" @(#)reboot.2 6.1 (Berkeley) %G%
7b826f9e 6.\"
ab9465ad 7.TH REBOOT 2 ""
7b826f9e
KM
8.UC 4
9.SH NAME
10reboot \- reboot system or halt processor
11.SH SYNOPSIS
12.nf
13.B #include <sys/reboot.h>
14.PP
15.B reboot(howto)
16.B int howto;
17.fi
18.SH DESCRIPTION
19.I Reboot
72252431 20reboots the system, and is invoked automatically
7b826f9e
KM
21in the event of unrecoverable system failures.
22.I Howto
23is a mask of options passed to the bootstrap program.
24The system call interface permits only RB_HALT or RB_AUTOBOOT
25to be passed to the reboot program; the other flags
26are used in scripts stored on the console storage media, or used
27in manual bootstrap procedures.
28When none of these options (e.g. RB_AUTOBOOT) is given, the system is rebooted
29from file \*(lqvmunix\*(rq in the root file system of unit 0
72252431 30of a disk chosen in a processor specific way.
7b826f9e
KM
31An automatic consistency check of the disks is then normally performed.
32.PP
33The bits of
34.I howto
35are:
36.TP
37RB_HALT
38the processor is simply halted; no reboot takes place.
72252431 39RB_HALT should be used with caution.
7b826f9e
KM
40.TP
41RB_ASKNAME
42Interpreted by the bootstrap program itself, causing it to
43inquire as to what file should be booted. Normally, the system is
72252431 44booted from the file \*(lqxx(0,0)vmunix\*(rq without asking.
7b826f9e
KM
45.TP
46RB_SINGLE
47Normally, the reboot procedure involves an automatic disk consistency
72252431 48check and then multi-user operations. RB_SINGLE prevents the consistency
7b826f9e 49check, rather simply booting the system with a single-user shell on
72252431
KM
50the console.
51RB_SINGLE is interpreted by the
7b826f9e
KM
52.IR init (8)
53program in the newly booted system.
54This switch is not available from the system call interface.
72252431
KM
55.PP
56Only the super-user may
57.I reboot
58a machine.
59.SH "RETURN VALUES"
60If successful, this call never returns. Otherwise, a \-1
61is returned and an error is returned in the global variable
62.IR errno .
63.SH ERRORS
64.TP 15
65[EPERM]
66The caller is not the super-user.
7b826f9e
KM
67.SH "SEE ALSO"
68crash(8), halt(8), init(8), reboot(8)
69.SH BUGS
72252431
KM
70The notion of ``console medium'', among other things,
71is specific to the VAX.