xref: /csrg-svn/lib/libc/sys/reboot.2 (revision 61183)
1*61183Sbostic.\" Copyright (c) 1980, 1991, 1993
2*61183Sbostic.\"	The Regents of the University of California.  All rights reserved.
320123Smckusick.\"
443568Strent.\" %sccs.include.redist.man%
520123Smckusick.\"
6*61183Sbostic.\"     @(#)reboot.2	8.1 (Berkeley) 06/04/93
738053Sbostic.\"
847208Scael.Dd
947208Scael.Dt REBOOT 2
1047208Scael.Os BSD 4
1147208Scael.Sh NAME
1247208Scael.Nm reboot
1347208Scael.Nd reboot system or halt processor
1447208Scael.Sh SYNOPSIS
1547208Scael.Fd #include <unistd.h>
1647208Scael.Fd #include <sys/reboot.h>
1747208Scael.Ft int
1847208Scael.Fn reboot "int howto"
1947208Scael.Sh DESCRIPTION
2047208Scael.Fn Reboot
2144761Sbosticreboots the system.
2244761SbosticOnly the super-user may reboot a machine on demand.
2344761SbosticHowever, a reboot is invoked
2444761Sbosticautomatically in the event of unrecoverable system failures.
2547208Scael.Pp
2647208Scael.Fa Howto
2747208Scaelis a mask of options; the system call interface allows the following
2847208Scaeloptions, defined in the include file
2947208Scael.Aq Pa sys/reboot.h ,
3047208Scaelto be passed
3144761Sbosticto the new kernel or the new bootstrap and init programs.
3247208Scael.Bl -tag -width RB_INITNAMEA
3347208Scael.It Dv RB_AUTOBOOT
3444761SbosticThe default, causing the system to reboot in its usual fashion.
3547208Scael.It Dv RB_ASKNAME
3620123SmckusickInterpreted by the bootstrap program itself, causing it to
3744761Sbosticprompt on the console as to what file should be booted.
3847208ScaelNormally, the system is booted from the file
3947208Scael.Dq Em xx Ns No (0,0)vmunix ,
4047208Scaelwhere
4147208Scael.Em xx
4247208Scaelis the default disk name,
4344761Sbosticwithout prompting for the file name.
4447208Scael.It Dv RB_DFLTROOT
4544761SbosticUse the compiled in root device.
4644761SbosticNormally, the system uses the device from which it was booted
4744761Sbosticas the root device if possible.
4844761Sbostic(The default behavior is dependent on the ability of the bootstrap program
4944761Sbosticto determine the drive from which it was loaded, which is not possible
5044761Sbosticon all systems.)
5147208Scael.It Dv RB_DUMP
5244761SbosticDump kernel memory before rebooting; see
5347208Scael.Xr savecore 8
5444761Sbosticfor more information.
5547208Scael.It Dv RB_HALT
5644761Sbosticthe processor is simply halted; no reboot takes place.
5744761SbosticThis option should be used with caution.
5847208Scael.It Dv RB_INITNAME
5944761SbosticAn option allowing the specification of an init program (see
6047208Scael.Xr init 8 )
6147208Scaelother than
6247208Scael.Pa /sbin/init
6347208Scaelto be run when the system reboots.
6444761SbosticThis switch is not currently available.
6547208Scael.It Dv RB_KDB
6644761SbosticLoad the symbol table and enable a built-in debugger in the system.
6744761SbosticThis option will have no useful function if the kernel is not configured
6844761Sbosticfor debugging.
6944761SbosticSeveral other options have different meaning if combined
7044761Sbosticwith this option, although their use may not be possible
7144761Sbosticvia the
7247208Scael.Fn reboot
7344761Sbosticcall.
7444761SbosticSee
7547208Scael.Xr kadb 4
7644761Sbosticfor more information.
7747208Scael.It Dv RB_NOSYNC
7844761SbosticNormally, the disks are sync'd (see
7947208Scael.Xr sync 8 )
8044761Sbosticbefore the processor is halted or rebooted.
8144761SbosticThis option may be useful if file system changes have been made manually
8244761Sbosticor if the processor is on fire.
8347208Scael.It Dv RB_RDONLY
8444761SbosticInitially mount the root file system read-only.
8547208ScaelThis is currently the default, and this option has been deprecated.
8647208Scael.It Dv RB_SINGLE
8720123SmckusickNormally, the reboot procedure involves an automatic disk consistency
8844761Sbosticcheck and then multi-user operations.
8947208Scael.Dv RB_SINGLE
9047208Scaelprevents this, booting the system with a single-user shell
9144761Sbosticon the console.
9247208Scael.Dv RB_SINGLE
9347208Scaelis actually interpreted by the
9447208Scael.Xr init 8
9520123Smckusickprogram in the newly booted system.
9647208Scael.Pp
9747208ScaelWhen no options are given (i.e.,
9847208Scael.Dv RB_AUTOBOOT
9947208Scaelis used), the system is
10044761Sbosticrebooted from file ``vmunix'' in the root file system of unit 0
10144761Sbosticof a disk chosen in a processor specific way.
10247208ScaelAn automatic consistency check of the disks is normally performed
10344761Sbostic(see
10447208Scael.Xr fsck 8 ) .
10547208Scael.El
10647208Scael.Sh RETURN VALUES
10744761SbosticIf successful, this call never returns.
10847208ScaelOtherwise, a -1 is returned and an error is returned in the global
10944761Sbosticvariable
11047208Scael.Va errno .
11147208Scael.Sh ERRORS
11247208Scael.Bl -tag -width Er
11347208Scael.It Bq Er EPERM
11420124SmckusickThe caller is not the super-user.
11547208Scael.El
11647208Scael.Sh SEE ALSO
11747208Scael.Xr kadb 4 ,
11847208Scael.Xr crash 8 ,
11947208Scael.Xr halt 8 ,
12047208Scael.Xr init 8 ,
12147208Scael.Xr reboot 8 ,
12247208Scael.Xr savecore 8
12347208Scael.Sh BUGS
12447208ScaelThe HP300 implementation supports neither
12547208Scael.Dv RB_DFLTROOT
12647208Scaelnor
12747208Scael.Dv RB_KDB .
12847208Scael.Sh HISTORY
12947208ScaelThe
13047208Scael.Nm
13147208Scaelfunction call appeared in
13247208Scael.Bx 4.0 .
133