use isinf(3) and isnan(3) instead of rolling our own
[unix-history] / usr / src / lib / libc / sys / reboot.2
CommitLineData
931b8415 1.\" Copyright (c) 1980, 1991 The Regents of the University of California.
88b3ccf2 2.\" All rights reserved.
7b826f9e 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
88b3ccf2 5.\"
931b8415 6.\" @(#)reboot.2 6.5 (Berkeley) %G%
7b826f9e 7.\"
931b8415
CL
8.Dd
9.Dt REBOOT 2
10.Os BSD 4
11.Sh NAME
12.Nm reboot
13.Nd reboot system or halt processor
14.Sh SYNOPSIS
15.Fd #include <unistd.h>
16.Fd #include <sys/reboot.h>
17.Ft int
18.Fn reboot "int howto"
19.Sh DESCRIPTION
20.Fn Reboot
31012fc9
KB
21reboots the system.
22Only the super-user may reboot a machine on demand.
23However, a reboot is invoked
24automatically in the event of unrecoverable system failures.
931b8415
CL
25.Pp
26.Fa Howto
27is a mask of options; the system call interface allows the following
28options, defined in the include file
29.Aq Pa sys/reboot.h ,
30to be passed
31012fc9 31to the new kernel or the new bootstrap and init programs.
931b8415
CL
32.Bl -tag -width RB_INITNAMEA
33.It Dv RB_AUTOBOOT
31012fc9 34The default, causing the system to reboot in its usual fashion.
931b8415 35.It Dv RB_ASKNAME
7b826f9e 36Interpreted by the bootstrap program itself, causing it to
31012fc9 37prompt on the console as to what file should be booted.
931b8415
CL
38Normally, the system is booted from the file
39.Dq Em xx Ns No (0,0)vmunix ,
40where
41.Em xx
42is the default disk name,
31012fc9 43without prompting for the file name.
931b8415 44.It Dv RB_DFLTROOT
31012fc9
KB
45Use the compiled in root device.
46Normally, the system uses the device from which it was booted
47as the root device if possible.
48(The default behavior is dependent on the ability of the bootstrap program
49to determine the drive from which it was loaded, which is not possible
50on all systems.)
931b8415 51.It Dv RB_DUMP
31012fc9 52Dump kernel memory before rebooting; see
931b8415 53.Xr savecore 8
31012fc9 54for more information.
931b8415 55.It Dv RB_HALT
31012fc9
KB
56the processor is simply halted; no reboot takes place.
57This option should be used with caution.
931b8415 58.It Dv RB_INITNAME
31012fc9 59An option allowing the specification of an init program (see
931b8415
CL
60.Xr init 8 )
61other than
62.Pa /sbin/init
63to be run when the system reboots.
31012fc9 64This switch is not currently available.
931b8415 65.It Dv RB_KDB
31012fc9
KB
66Load the symbol table and enable a built-in debugger in the system.
67This option will have no useful function if the kernel is not configured
68for debugging.
69Several other options have different meaning if combined
70with this option, although their use may not be possible
71via the
931b8415 72.Fn reboot
31012fc9
KB
73call.
74See
931b8415 75.Xr kadb 4
31012fc9 76for more information.
931b8415 77.It Dv RB_NOSYNC
31012fc9 78Normally, the disks are sync'd (see
931b8415 79.Xr sync 8 )
31012fc9
KB
80before the processor is halted or rebooted.
81This option may be useful if file system changes have been made manually
82or if the processor is on fire.
931b8415 83.It Dv RB_RDONLY
31012fc9 84Initially mount the root file system read-only.
931b8415
CL
85This is currently the default, and this option has been deprecated.
86.It Dv RB_SINGLE
7b826f9e 87Normally, the reboot procedure involves an automatic disk consistency
31012fc9 88check and then multi-user operations.
931b8415
CL
89.Dv RB_SINGLE
90prevents this, booting the system with a single-user shell
31012fc9 91on the console.
931b8415
CL
92.Dv RB_SINGLE
93is actually interpreted by the
94.Xr init 8
7b826f9e 95program in the newly booted system.
931b8415
CL
96.Pp
97When no options are given (i.e.,
98.Dv RB_AUTOBOOT
99is used), the system is
31012fc9
KB
100rebooted from file ``vmunix'' in the root file system of unit 0
101of a disk chosen in a processor specific way.
931b8415 102An automatic consistency check of the disks is normally performed
31012fc9 103(see
931b8415
CL
104.Xr fsck 8 ) .
105.El
106.Sh RETURN VALUES
31012fc9 107If successful, this call never returns.
931b8415 108Otherwise, a -1 is returned and an error is returned in the global
31012fc9 109variable
931b8415
CL
110.Va errno .
111.Sh ERRORS
112.Bl -tag -width Er
113.It Bq Er EPERM
72252431 114The caller is not the super-user.
931b8415
CL
115.El
116.Sh SEE ALSO
117.Xr kadb 4 ,
118.Xr crash 8 ,
119.Xr halt 8 ,
120.Xr init 8 ,
121.Xr reboot 8 ,
122.Xr savecore 8
123.Sh BUGS
124The HP300 implementation supports neither
125.Dv RB_DFLTROOT
126nor
127.Dv RB_KDB .
128.Sh HISTORY
129The
130.Nm
131function call appeared in
132.Bx 4.0 .