Commit | Line | Data |
---|---|---|
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 |
21 | reboots the system. |
22 | Only the super-user may reboot a machine on demand. | |
23 | However, a reboot is invoked | |
24 | automatically in the event of unrecoverable system failures. | |
931b8415 CL |
25 | .Pp |
26 | .Fa Howto | |
27 | is a mask of options; the system call interface allows the following | |
28 | options, defined in the include file | |
29 | .Aq Pa sys/reboot.h , | |
30 | to be passed | |
31012fc9 | 31 | to the new kernel or the new bootstrap and init programs. |
931b8415 CL |
32 | .Bl -tag -width RB_INITNAMEA |
33 | .It Dv RB_AUTOBOOT | |
31012fc9 | 34 | The default, causing the system to reboot in its usual fashion. |
931b8415 | 35 | .It Dv RB_ASKNAME |
7b826f9e | 36 | Interpreted by the bootstrap program itself, causing it to |
31012fc9 | 37 | prompt on the console as to what file should be booted. |
931b8415 CL |
38 | Normally, the system is booted from the file |
39 | .Dq Em xx Ns No (0,0)vmunix , | |
40 | where | |
41 | .Em xx | |
42 | is the default disk name, | |
31012fc9 | 43 | without prompting for the file name. |
931b8415 | 44 | .It Dv RB_DFLTROOT |
31012fc9 KB |
45 | Use the compiled in root device. |
46 | Normally, the system uses the device from which it was booted | |
47 | as the root device if possible. | |
48 | (The default behavior is dependent on the ability of the bootstrap program | |
49 | to determine the drive from which it was loaded, which is not possible | |
50 | on all systems.) | |
931b8415 | 51 | .It Dv RB_DUMP |
31012fc9 | 52 | Dump kernel memory before rebooting; see |
931b8415 | 53 | .Xr savecore 8 |
31012fc9 | 54 | for more information. |
931b8415 | 55 | .It Dv RB_HALT |
31012fc9 KB |
56 | the processor is simply halted; no reboot takes place. |
57 | This option should be used with caution. | |
931b8415 | 58 | .It Dv RB_INITNAME |
31012fc9 | 59 | An option allowing the specification of an init program (see |
931b8415 CL |
60 | .Xr init 8 ) |
61 | other than | |
62 | .Pa /sbin/init | |
63 | to be run when the system reboots. | |
31012fc9 | 64 | This switch is not currently available. |
931b8415 | 65 | .It Dv RB_KDB |
31012fc9 KB |
66 | Load the symbol table and enable a built-in debugger in the system. |
67 | This option will have no useful function if the kernel is not configured | |
68 | for debugging. | |
69 | Several other options have different meaning if combined | |
70 | with this option, although their use may not be possible | |
71 | via the | |
931b8415 | 72 | .Fn reboot |
31012fc9 KB |
73 | call. |
74 | See | |
931b8415 | 75 | .Xr kadb 4 |
31012fc9 | 76 | for more information. |
931b8415 | 77 | .It Dv RB_NOSYNC |
31012fc9 | 78 | Normally, the disks are sync'd (see |
931b8415 | 79 | .Xr sync 8 ) |
31012fc9 KB |
80 | before the processor is halted or rebooted. |
81 | This option may be useful if file system changes have been made manually | |
82 | or if the processor is on fire. | |
931b8415 | 83 | .It Dv RB_RDONLY |
31012fc9 | 84 | Initially mount the root file system read-only. |
931b8415 CL |
85 | This is currently the default, and this option has been deprecated. |
86 | .It Dv RB_SINGLE | |
7b826f9e | 87 | Normally, the reboot procedure involves an automatic disk consistency |
31012fc9 | 88 | check and then multi-user operations. |
931b8415 CL |
89 | .Dv RB_SINGLE |
90 | prevents this, booting the system with a single-user shell | |
31012fc9 | 91 | on the console. |
931b8415 CL |
92 | .Dv RB_SINGLE |
93 | is actually interpreted by the | |
94 | .Xr init 8 | |
7b826f9e | 95 | program in the newly booted system. |
931b8415 CL |
96 | .Pp |
97 | When no options are given (i.e., | |
98 | .Dv RB_AUTOBOOT | |
99 | is used), the system is | |
31012fc9 KB |
100 | rebooted from file ``vmunix'' in the root file system of unit 0 |
101 | of a disk chosen in a processor specific way. | |
931b8415 | 102 | An 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 | 107 | If successful, this call never returns. |
931b8415 | 108 | Otherwise, a -1 is returned and an error is returned in the global |
31012fc9 | 109 | variable |
931b8415 CL |
110 | .Va errno . |
111 | .Sh ERRORS | |
112 | .Bl -tag -width Er | |
113 | .It Bq Er EPERM | |
72252431 | 114 | The 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 | |
124 | The HP300 implementation supports neither | |
125 | .Dv RB_DFLTROOT | |
126 | nor | |
127 | .Dv RB_KDB . | |
128 | .Sh HISTORY | |
129 | The | |
130 | .Nm | |
131 | function call appeared in | |
132 | .Bx 4.0 . |