OSDN Git Service

c2a2f25ef3c17721145f7e23ad0630a1c0bfd85c
[linuxjm/LDP_man-pages.git] / draft / man2 / reboot.2
1 .\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
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
24 .\"
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>
32 .\"
33 .\"WORD         halt            停止
34 .\"WORD         stop            停止
35 .\"WORD         reboot          再起動
36 .\"
37 .TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual"
38 .\"O .SH NAME
39 .SH 名前
40 .\"O reboot \- reboot or enable/disable Ctrl-Alt-Del
41 reboot \- 再起動する。または Ctrl-Alt-Delを有効・無効にする
42 .\"O .SH SYNOPSIS
43 .SH 書式
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 引数として
51    指定することができる。*/
52 .sp
53 .B #include <unistd.h>
54 .br
55 .B #include <linux/reboot.h>
56 .sp
57 .BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
58 .sp
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) となっている。 */
65 .sp
66 .B #include <unistd.h>
67 .br
68 .B #include <sys/reboot.h>
69 .sp
70 .BI "int reboot(int " cmd );
71 .\"O .SH DESCRIPTION
72 .SH 説明
73 .\"O The
74 .\"O .BR reboot ()
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)).
79 .BR reboot ()
80 はシステムを再起動する。または再起動のキーストロークである
81 Ctrl-Alt-Delete (CAD) を有効/無効にする。
82 このキーストロークは
83 .BR loadkeys (1)
84 によって変更できる。
85 .PP
86 .\"O This system call will fail (with
87 .\"O .BR EINVAL )
88 .\"O unless
89 .\"O .I magic
90 .\"O equals
91 .\"O .B LINUX_REBOOT_MAGIC1
92 .\"O (that is, 0xfee1dead) and
93 .\"O .I magic2
94 .\"O equals
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
107 .\"O .IR magic2 .
108 .\"O (The hexadecimal values of these constants are meaningful.)
109 .\"O The
110 .\"O .I cmd
111 .\"O argument can have the following values:
112 .I magic
113
114 .B LINUX_REBOOT_MAGIC1
115 (値は 0xfee1dead) であり、かつ
116 .I magic2
117
118 .B LINUX_REBOOT_MAGIC2
119 (672274793) でなければこのシステムコールは失敗し、
120 .B EINVAL
121 が返される。
122 しかし 2.1.17 からは
123 .B LINUX_REBOOT_MAGIC2A
124 (85072278) が、
125 また 2.1.97 からは
126 .B LINUX_REBOOT_MAGIC2B
127 (369367448) が、
128 2.5.71 からは
129 .B LINUX_REBOOT_MAGIC2C
130 (537993216) が
131 .I magic2
132 の値として指定できるようになった (これらの定数の 16 進での
133 表記にはちょっとした意味がある)。
134 .I cmd
135 引数には以下の値を指定できる。
136 .TP
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
142 .\"O .BR sync (2),
143 .\"O data will be lost.
144 "Restarting system." というメッセージが表示され、
145 デフォルトの再起動処理がただちに実行される。
146 先に
147 .BR sync (2)
148 を行なわないと、データが失われる。
149 .TP
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
155 .\"O .BR sync (2),
156 .\"O data will be lost.
157 (RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 以降)
158 "System halted." というメッセージが表示され、システムは停止 (halt) する。
159 制御は ROM モニタに移る (ROM モニタがある場合)。
160 先に
161 .BR sync (2)
162 を行なわないと、データが失われる。
163 .TP
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
169 .\"O .BR sync (2),
170 .\"O data will be lost.
171 (0x4321fedc; 2.1.30 以降)
172 "Power down" というメッセージが表示され、システムは停止 (stop) する。
173 可能な場合はシステムの電源が落とされる。
174 先に
175 .BR sync (2)
176 を行なわないと、データが失われる。
177 .TP
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
182 .\"O .IR arg )
183 .\"O is performed immediately.
184 .\"O If not preceded by a
185 .\"O .BR sync (2),
186 .\"O data will be lost.
187 (0xa1b2c3d4; 2.1.30 以降)
188 "Restarting system with command \(aq%s\(aq" というメッセージが表示され、
189 ただちに (
190 .I arg
191 に指定されたコマンドを用いて) 再起動 (restart) が行われる。
192 先に
193 .BR sync (2)
194 を行なわないと、データが失われる。
195 .TP
196 .B LINUX_REBOOT_CMD_CAD_ON
197 .\"O (RB_ENABLE_CAD, 0x89abcdef).
198 .\"O CAD is enabled.
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)
203 CAD を有効にする。
204 これ以降に CAD キーストロークが入力されると、
205 ただちに
206 .B LINUX_REBOOT_CMD_RESTART
207 に関連付けられた動作が行われるようになる。
208 .TP
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
213 .\"O .B SIGINT
214 .\"O signal to be
215 .\"O sent to init (process 1), whereupon this process may decide upon a
216 .\"O proper action (maybe: kill all processes, sync, reboot).
217 (RB_DISABLE_CAD, 0)
218 CAD を無効にする。
219 これ以降に CAD キーストロークが入力されると、
220 .B SIGINT
221 シグナルが init (プロセス 1) に送られる。
222 このシグナルを受けると、おそらく init プロセスは
223 前もって定められた動作を行うことになる (多分すべてのプロセスの kill,
224 sync, 再起動)。
225 .LP
226 .\"O Only the superuser may call
227 .\"O .BR reboot ().
228 スーパーユーザーだけが
229 .BR reboot ()
230 を呼び出すことができる。
231 .LP
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 経由の再起動を
242 設定できる。
243 .\"O .SH "RETURN VALUE"
244 .SH 返り値
245 .\"O For the values of
246 .\"O .I cmd
247 .\"O that stop or restart the system,
248 .\"O a successful call to
249 .\"O .BR reboot ()
250 .\"O does not return.
251 .\"O For the other
252 .\"O .I cmd
253 .\"O values, zero is returned on success.
254 .\"O In all cases, \-1 is returned on failure, and
255 .\"O .I errno
256 .\"O is set appropriately.
257 .I cmd
258 がシステムの停止や再起動を表す値の場合、呼び出しが成功すると
259 .BR reboot ()
260 は返らない。
261 .I cmd
262 が他の値の場合には、成功すると 0 が返る。
263 .I cmd
264 の値に関わらず、失敗の場合には \-1 が返り、
265 .I errno
266 が適切に設定される。
267 .\"O .SH ERRORS
268 .SH エラー
269 .TP
270 .B EFAULT
271 .\"O Problem with getting userspace data under
272 .\"O .BR LINUX_REBOOT_CMD_RESTART2 .
273 .B LINUX_REBOOT_CMD_RESTART2
274 の時にユーザースペースのデータの取得に問題があった。
275 .TP
276 .B EINVAL
277 .\"O Bad magic numbers or \fIcmd\fP.
278 magic の数字か \fIcmd\fP が間違っている。
279 .TP
280 .B EPERM
281 .\"O The calling process has insufficient privilege to call
282 .\"O .BR reboot ();
283 .\"O the
284 .\"O .B CAP_SYS_BOOT
285 .\"O capability is required.
286 呼び出し元プロセスに
287 .BR reboot ()
288 を呼び出すのに十分な権限がなかった。
289 .B CAP_SYS_BOOT
290 ケーパビリティが必要である。
291 .\"O .SH "CONFORMING TO"
292 .SH 準拠
293 .\"O .BR reboot ()
294 .\"O is Linux-specific,
295 .\"O and should not be used in programs intended to be portable.
296 .BR reboot ()
297 は Linux に特有であり、移植を考慮したプログラムでは用いるべきではない。
298 .\"O .SH "SEE ALSO"
299 .SH 関連項目
300 .BR sync (2),
301 .BR bootparam (7),
302 .BR ctrlaltdel (8),
303 .BR halt (8),
304 .BR reboot (8),
305 .BR capabilities (7)