This commit was manufactured by cvs2svn to create tag 'FreeBSD-release/1.0'.
[unix-history] / lib / libc / sys / reboot.2
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1980, 1991 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)reboot.2 6.5 (Berkeley) 3/10/91
33.\"
34.Dd March 10, 1991
35.Dt REBOOT 2
36.Os BSD 4
37.Sh NAME
38.Nm reboot
39.Nd reboot system or halt processor
40.Sh SYNOPSIS
41.Fd #include <unistd.h>
42.Fd #include <sys/reboot.h>
43.Ft int
44.Fn reboot "int howto"
45.Sh DESCRIPTION
46.Fn Reboot
47reboots the system.
48Only the super-user may reboot a machine on demand.
49However, a reboot is invoked
50automatically in the event of unrecoverable system failures.
51.Pp
52.Fa Howto
53is a mask of options; the system call interface allows the following
54options, defined in the include file
55.Aq Pa sys/reboot.h ,
56to be passed
57to the new kernel or the new bootstrap and init programs.
58.Bl -tag -width RB_INITNAMEA
59.It Dv RB_AUTOBOOT
60The default, causing the system to reboot in its usual fashion.
61.It Dv RB_ASKNAME
62Interpreted by the bootstrap program itself, causing it to
63prompt on the console as to what file should be booted.
64Normally, the system is booted from the file
78ed81a3 65.Dq Em xx Ns No (0,0)386bsd ,
15637ed4
RG
66where
67.Em xx
68is the default disk name,
69without prompting for the file name.
70.It Dv RB_DFLTROOT
71Use the compiled in root device.
72Normally, the system uses the device from which it was booted
73as the root device if possible.
74(The default behavior is dependent on the ability of the bootstrap program
75to determine the drive from which it was loaded, which is not possible
76on all systems.)
77.It Dv RB_DUMP
78Dump kernel memory before rebooting; see
79.Xr savecore 8
80for more information.
81.It Dv RB_HALT
82the processor is simply halted; no reboot takes place.
83This option should be used with caution.
84.It Dv RB_INITNAME
85An option allowing the specification of an init program (see
86.Xr init 8 )
87other than
88.Pa /sbin/init
89to be run when the system reboots.
90This switch is not currently available.
91.It Dv RB_KDB
92Load the symbol table and enable a built-in debugger in the system.
93This option will have no useful function if the kernel is not configured
94for debugging.
95Several other options have different meaning if combined
96with this option, although their use may not be possible
97via the
98.Fn reboot
99call.
100See
101.Xr kadb 4
102for more information.
103.It Dv RB_NOSYNC
104Normally, the disks are sync'd (see
105.Xr sync 8 )
106before the processor is halted or rebooted.
107This option may be useful if file system changes have been made manually
108or if the processor is on fire.
109.It Dv RB_RDONLY
110Initially mount the root file system read-only.
111This is currently the default, and this option has been deprecated.
112.It Dv RB_SINGLE
113Normally, the reboot procedure involves an automatic disk consistency
114check and then multi-user operations.
115.Dv RB_SINGLE
116prevents this, booting the system with a single-user shell
117on the console.
118.Dv RB_SINGLE
119is actually interpreted by the
120.Xr init 8
121program in the newly booted system.
122.Pp
123When no options are given (i.e.,
124.Dv RB_AUTOBOOT
125is used), the system is
78ed81a3 126rebooted from file ``386bsd'' in the root file system of unit 0
15637ed4
RG
127of a disk chosen in a processor specific way.
128An automatic consistency check of the disks is normally performed
129(see
130.Xr fsck 8 ) .
131.El
132.Sh RETURN VALUES
133If successful, this call never returns.
134Otherwise, a -1 is returned and an error is returned in the global
135variable
136.Va errno .
137.Sh ERRORS
138.Bl -tag -width Er
139.It Bq Er EPERM
140The caller is not the super-user.
141.El
142.Sh SEE ALSO
143.Xr kadb 4 ,
144.Xr crash 8 ,
145.Xr halt 8 ,
146.Xr init 8 ,
147.Xr reboot 8 ,
148.Xr savecore 8
149.Sh BUGS
150The HP300 implementation supports neither
151.Dv RB_DFLTROOT
152nor
153.Dv RB_KDB .
154.Sh HISTORY
155The
156.Nm
157function call appeared in
158.Bx 4.0 .