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"
39 reboot \- 再起動する。または Ctrl-Alt-Delを有効・無効にする
41 /* libc4 と libc5 でのライブラリコールとシステムコールは同じである。
42 またカーネル 2.1.30 以降では、定数としてシンボリックな名前
43 LINUX_REBOOT_* が定義されており、呼び出しの第 4 引数として
46 .B #include <unistd.h>
48 .B #include <linux/reboot.h>
50 .BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
52 /* glibc では、関連する定数に RB_* というシンボリックな名前が付け
53 られている。ライブラリ関数の引数は 1 つで、3 引数のシステムコールの
54 ラッパ (wrapper) となっている。 */
56 .B #include <unistd.h>
58 .B #include <sys/reboot.h>
60 .BI "int reboot(int " cmd );
63 はシステムを再起動する。または再起動のキーストロークである
64 Ctrl-Alt-Delete (CAD) を有効/無効にする。
71 .B LINUX_REBOOT_MAGIC1
72 (値は 0xfee1dead) であり、かつ
75 .B LINUX_REBOOT_MAGIC2
76 (672274793) でなければこのシステムコールは失敗し、
80 .B LINUX_REBOOT_MAGIC2A
83 .B LINUX_REBOOT_MAGIC2B
86 .B LINUX_REBOOT_MAGIC2C
89 の値として指定できるようになった (これらの定数の 16 進での
94 .B LINUX_REBOOT_CMD_RESTART
95 (RB_AUTOBOOT, 0x1234567)
96 "Restarting system." というメッセージが表示され、
97 デフォルトの再起動処理がただちに実行される。
102 .B LINUX_REBOOT_CMD_HALT
103 (RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 以降)
104 "System halted." というメッセージが表示され、システムは停止 (halt) する。
105 制御は ROM モニタに移る (ROM モニタがある場合)。
110 .B LINUX_REBOOT_CMD_POWER_OFF
111 (0x4321fedc; 2.1.30 以降)
112 "Power down" というメッセージが表示され、システムは停止 (stop) する。
118 .B LINUX_REBOOT_CMD_RESTART2
119 (0xa1b2c3d4; 2.1.30 以降)
120 "Restarting system with command \(aq%s\(aq" というメッセージが表示され、
123 に指定されたコマンドを用いて) 再起動 (restart) が行われる。
128 .B LINUX_REBOOT_CMD_CAD_ON
129 (RB_ENABLE_CAD, 0x89abcdef)
131 これ以降に CAD キーストロークが入力されると、
133 .B LINUX_REBOOT_CMD_RESTART
134 に関連付けられた動作が行われるようになる。
136 .B LINUX_REBOOT_CMD_CAD_OFF
139 これ以降に CAD キーストロークが入力されると、
141 シグナルが init (プロセス 1) に送られる。
142 このシグナルを受けると、おそらく init プロセスは
143 前もって定められた動作を行うことになる (多分すべてのプロセスの kill,
150 上述のアクションの実際の効果はアーキテクチャに依存する。
151 i386 アーキテクチャでは、現在のところ (2.1.122) 付加引数は
152 何も行わないが、再起動のタイプをカーネルのコマンドライン引数
153 ("reboot=...") によって定めることができる。
154 これには warm または cold と、 hard または BIOS 経由の再起動を
158 がシステムの停止や再起動を表す値の場合、呼び出しが成功すると
162 が他の値の場合には、成功すると 0 が返る。
164 の値に関わらず、失敗の場合には \-1 が返り、
170 .B LINUX_REBOOT_CMD_RESTART2
171 の時にユーザースペースのデータの取得に問題があった。
174 magic の数字か \fIcmd\fP が間違っている。
184 は Linux に特有であり、移植を考慮したプログラムでは用いるべきではない。