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