1 .\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
23 .\" Added notes on capability requirements
25 .\" Japanese Version Copyright (c) 1997 Ueyama Rui
26 .\" all rights reserved.
27 .\" Translated Mon Sep 29 23:21:04 JST 1997
28 .\" by Ueyama Rui <rui@campus.ne.jp>
29 .\" Updated & Modified Mon Mar 1 1999
30 .\" by NAKANO Takeo <nakano@apm.seikei.ac.jp>
31 .\" Updated Sat Oct 11 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
37 .TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual"
40 .\"O reboot \- reboot or enable/disable Ctrl-Alt-Del
41 reboot \- 再起動する。または Ctrl-Alt-Delを有効・無効にする
44 .\"O /* For libc4 and libc5 the library call and the system call
45 .\"O are identical, and since kernel version 2.1.30 there are
46 .\"O symbolic names LINUX_REBOOT_* for the constants and a
47 .\"O fourth argument to the call: */
48 /* libc4 と libc5 でのライブラリコールとシステムコールは同じである。
49 またカーネル 2.1.30 以降では、定数としてシンボリックな名前
50 LINUX_REBOOT_* が定義されており、呼び出しの第 4 引数として
53 .B #include <unistd.h>
55 .B #include <linux/reboot.h>
57 .BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
59 .\"O /* Under glibc some of the constants involved have gotten
60 .\"O symbolic names RB_*, and the library call is a 1-argument
61 .\"O wrapper around the 3-argument system call:
62 /* glibc では、関連する定数に RB_* というシンボリックな名前が付け
63 られている。ライブラリ関数の引数は 1 つで、3 引数のシステムコールの
64 ラッパ (wrapper) となっている。 */
66 .B #include <unistd.h>
68 .B #include <sys/reboot.h>
70 .BI "int reboot(int " cmd );
75 .\"O call reboots the system, or enables/disables the reboot keystroke
76 .\"O (abbreviated CAD, since the default is Ctrl-Alt-Delete;
77 .\"O it can be changed using
78 .\"O .BR loadkeys (1)).
80 はシステムを再起動する。または再起動のキーストロークである
81 Ctrl-Alt-Delete (CAD) を有効/無効にする。
86 .\"O This system call will fail (with
91 .\"O .B LINUX_REBOOT_MAGIC1
92 .\"O (that is, 0xfee1dead) and
95 .\"O .B LINUX_REBOOT_MAGIC2
96 .\"O (that is, 672274793).
97 .\"O However, since 2.1.17 also
98 .\"O .B LINUX_REBOOT_MAGIC2A
99 .\"O (that is, 85072278)
100 .\"O and since 2.1.97 also
101 .\"O .B LINUX_REBOOT_MAGIC2B
102 .\"O (that is, 369367448)
103 .\"O and since 2.5.71 also
104 .\"O .B LINUX_REBOOT_MAGIC2C
105 .\"O (that is, 537993216)
106 .\"O are permitted as value for
108 .\"O (The hexadecimal values of these constants are meaningful.)
111 .\"O argument can have the following values:
114 .B LINUX_REBOOT_MAGIC1
115 (値は 0xfee1dead) であり、かつ
118 .B LINUX_REBOOT_MAGIC2
119 (672274793) でなければこのシステムコールは失敗し、
123 .B LINUX_REBOOT_MAGIC2A
126 .B LINUX_REBOOT_MAGIC2B
129 .B LINUX_REBOOT_MAGIC2C
132 の値として指定できるようになった (これらの定数の 16 進での
137 .B LINUX_REBOOT_CMD_RESTART
138 (RB_AUTOBOOT, 0x1234567)
139 .\"O The message "Restarting system." is printed, and a default
140 .\"O restart is performed immediately.
141 .\"O If not preceded by a
143 .\"O data will be lost.
144 "Restarting system." というメッセージが表示され、
145 デフォルトの再起動処理がただちに実行される。
150 .B LINUX_REBOOT_CMD_HALT
151 .\"O (RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76).
152 .\"O The message "System halted." is printed, and the system is halted.
153 .\"O Control is given to the ROM monitor, if there is one.
154 .\"O If not preceded by a
156 .\"O data will be lost.
157 (RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 以降)
158 "System halted." というメッセージが表示され、システムは停止 (halt) する。
159 制御は ROM モニタに移る (ROM モニタがある場合)。
164 .B LINUX_REBOOT_CMD_POWER_OFF
165 .\"O (0x4321fedc; since 2.1.30).
166 .\"O The message "Power down." is printed, the system is stopped,
167 .\"O and all power is removed from the system, if possible.
168 .\"O If not preceded by a
170 .\"O data will be lost.
171 (0x4321fedc; 2.1.30 以降)
172 "Power down" というメッセージが表示され、システムは停止 (stop) する。
178 .B LINUX_REBOOT_CMD_RESTART2
179 .\"O (0xa1b2c3d4; since 2.1.30).
180 .\"O The message "Restarting system with command \(aq%s\(aq" is printed,
181 .\"O and a restart (using the command string given in
183 .\"O is performed immediately.
184 .\"O If not preceded by a
186 .\"O data will be lost.
187 (0xa1b2c3d4; 2.1.30 以降)
188 "Restarting system with command \(aq%s\(aq" というメッセージが表示され、
191 に指定されたコマンドを用いて) 再起動 (restart) が行われる。
196 .B LINUX_REBOOT_CMD_CAD_ON
197 .\"O (RB_ENABLE_CAD, 0x89abcdef).
199 .\"O This means that the CAD keystroke will immediately cause
200 .\"O the action associated with
201 .\"O .BR LINUX_REBOOT_CMD_RESTART .
202 (RB_ENABLE_CAD, 0x89abcdef)
204 これ以降に CAD キーストロークが入力されると、
206 .B LINUX_REBOOT_CMD_RESTART
207 に関連付けられた動作が行われるようになる。
209 .B LINUX_REBOOT_CMD_CAD_OFF
210 .\"O (RB_DISABLE_CAD, 0).
211 .\"O CAD is disabled.
212 .\"O This means that the CAD keystroke will cause a
215 .\"O sent to init (process 1), whereupon this process may decide upon a
216 .\"O proper action (maybe: kill all processes, sync, reboot).
219 これ以降に CAD キーストロークが入力されると、
221 シグナルが init (プロセス 1) に送られる。
222 このシグナルを受けると、おそらく init プロセスは
223 前もって定められた動作を行うことになる (多分すべてのプロセスの kill,
226 .\"O Only the superuser may call
232 .\"O The precise effect of the above actions depends on the architecture.
233 .\"O For the i386 architecture, the additional argument does not do
234 .\"O anything at present (2.1.122), but the type of reboot can be
235 .\"O determined by kernel command-line arguments ("reboot=...") to be
236 .\"O either warm or cold, and either hard or through the BIOS.
237 上述のアクションの実際の効果はアーキテクチャに依存する。
238 i386 アーキテクチャでは、現在のところ (2.1.122) 付加引数は
239 何も行わないが、再起動のタイプをカーネルのコマンドライン引数
240 ("reboot=...") によって定めることができる。
241 これには warm または cold と、 hard または BIOS 経由の再起動を
243 .\"O .SH "RETURN VALUE"
245 .\"O For the values of
247 .\"O that stop or restart the system,
248 .\"O a successful call to
250 .\"O does not return.
253 .\"O values, zero is returned on success.
254 .\"O In all cases, \-1 is returned on failure, and
256 .\"O is set appropriately.
258 がシステムの停止や再起動を表す値の場合、呼び出しが成功すると
262 が他の値の場合には、成功すると 0 が返る。
264 の値に関わらず、失敗の場合には \-1 が返り、
271 .\"O Problem with getting userspace data under
272 .\"O .BR LINUX_REBOOT_CMD_RESTART2 .
273 .B LINUX_REBOOT_CMD_RESTART2
274 の時にユーザースペースのデータの取得に問題があった。
277 .\"O Bad magic numbers or \fIcmd\fP.
278 magic の数字か \fIcmd\fP が間違っている。
281 .\"O The calling process has insufficient privilege to call
285 .\"O capability is required.
291 .\"O .SH "CONFORMING TO"
294 .\"O is Linux-specific,
295 .\"O and should not be used in programs intended to be portable.
297 は Linux に特有であり、移植を考慮したプログラムでは用いるべきではない。