]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/sys/reboot.2
This commit was generated by cvs2svn to compensate for changes in r159248,
[FreeBSD/FreeBSD.git] / lib / libc / sys / reboot.2
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  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    8.1 (Berkeley) 6/4/93
33 .\" $FreeBSD$
34 .\"
35 .Dd June 4, 1993
36 .Dt REBOOT 2
37 .Os
38 .Sh NAME
39 .Nm reboot
40 .Nd reboot system or halt processor
41 .Sh LIBRARY
42 .Lb libc
43 .Sh SYNOPSIS
44 .In unistd.h
45 .In sys/reboot.h
46 .Ft int
47 .Fn reboot "int howto"
48 .Sh DESCRIPTION
49 The
50 .Fn reboot
51 system call
52 reboots the system.
53 Only the super-user may reboot a machine on demand.
54 However, a reboot is invoked
55 automatically in the event of unrecoverable system failures.
56 .Pp
57 The
58 .Fa howto
59 argument
60 is a mask of options; the system call interface allows the following
61 options, defined in the include file
62 .In sys/reboot.h ,
63 to be passed
64 to the new kernel or the new bootstrap and init programs.
65 .Bl -tag -width RB_INITNAMEA
66 .It Dv RB_AUTOBOOT
67 The default, causing the system to reboot in its usual fashion.
68 .It Dv RB_ASKNAME
69 Interpreted by the bootstrap program itself, causing it to
70 prompt on the console as to what file should be booted.
71 Normally, the system is booted from the file
72 .Dq Ar xx Ns No (0,0)kernel ,
73 where
74 .Ar xx
75 is the default disk name,
76 without prompting for the file name.
77 .It Dv RB_DFLTROOT
78 Use the compiled in root device.
79 Normally, the system uses the device from which it was booted
80 as the root device if possible.
81 (The default behavior is dependent on the ability of the bootstrap program
82 to determine the drive from which it was loaded, which is not possible
83 on all systems.)
84 .It Dv RB_DUMP
85 Dump kernel memory before rebooting; see
86 .Xr savecore 8
87 for more information.
88 .It Dv RB_HALT
89 the processor is simply halted; no reboot takes place.
90 This option should be used with caution.
91 .It Dv RB_POWEROFF
92 After halting, the shutdown code will do what it can to turn
93 off the power.
94 This requires hardware support.
95 .It Dv RB_INITNAME
96 An option allowing the specification of an init program (see
97 .Xr init 8 )
98 other than
99 .Pa /sbin/init
100 to be run when the system reboots.
101 This switch is not currently available.
102 .It Dv RB_KDB
103 Load the symbol table and enable a built-in debugger in the system.
104 This option will have no useful function if the kernel is not configured
105 for debugging.
106 Several other options have different meaning if combined
107 with this option, although their use may not be possible
108 via the
109 .Fn reboot
110 system call.
111 See
112 .Xr ddb 4
113 for more information.
114 .It Dv RB_NOSYNC
115 Normally, the disks are sync'd (see
116 .Xr sync 8 )
117 before the processor is halted or rebooted.
118 This option may be useful if file system changes have been made manually
119 or if the processor is on fire.
120 .It Dv RB_RDONLY
121 Initially mount the root file system read-only.
122 This is currently the default, and this option has been deprecated.
123 .It Dv RB_SINGLE
124 Normally, the reboot procedure involves an automatic disk consistency
125 check and then multi-user operations.
126 .Dv RB_SINGLE
127 prevents this, booting the system with a single-user shell
128 on the console.
129 .Dv RB_SINGLE
130 is actually interpreted by the
131 .Xr init 8
132 program in the newly booted system.
133 .El
134 .Pp
135 When no options are given (i.e.,
136 .Dv RB_AUTOBOOT
137 is used), the system is
138 rebooted from file
139 .Dq kernel
140 in the root file system of unit 0
141 of a disk chosen in a processor specific way.
142 An automatic consistency check of the disks is normally performed
143 (see
144 .Xr fsck 8 ) .
145 .Sh RETURN VALUES
146 If successful, this call never returns.
147 Otherwise, a -1 is returned and an error is returned in the global
148 variable
149 .Va errno .
150 .Sh ERRORS
151 .Bl -tag -width Er
152 .It Bq Er EPERM
153 The caller is not the super-user.
154 .El
155 .Sh SEE ALSO
156 .Xr crash 8 ,
157 .Xr halt 8 ,
158 .Xr init 8 ,
159 .Xr reboot 8 ,
160 .Xr savecore 8
161 .Sh HISTORY
162 The
163 .Fn reboot
164 system call appeared in
165 .Bx 4.0 .
166 .Sh BUGS
167 The HP300 implementation supports neither
168 .Dv RB_DFLTROOT
169 nor
170 .Dv RB_KDB .