.\" Copyright (c) 1998 Andries Brouwer (aeb@cwi.nl), 24 September 1998 .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" Modified, 27 May 2004, Michael Kerrisk .\" Added notes on capability requirements .\" .\" Japanese Version Copyright (c) 1997 Ueyama Rui .\" all rights reserved. .\" Translated Mon Sep 29 23:21:04 JST 1997 .\" by Ueyama Rui .\" Updated & Modified Mon Mar 1 1999 .\" by NAKANO Takeo .\" Updated Sat Oct 11 JST 2003 by Kentaro Shirakata .\" .\"WORD halt 停止 .\"WORD stop 停止 .\"WORD reboot 再起動 .\" .TH REBOOT 2 2008-02-11 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O reboot \- reboot or enable/disable Ctrl-Alt-Del reboot \- 再起動する。または Ctrl-Alt-Delを有効・無効にする .\"O .SH SYNOPSIS .SH 書式 .\"O /* For libc4 and libc5 the library call and the system call .\"O are identical, and since kernel version 2.1.30 there are .\"O symbolic names LINUX_REBOOT_* for the constants and a .\"O fourth argument to the call: */ /* libc4 と libc5 でのライブラリコールとシステムコールは同じである。 またカーネル 2.1.30 以降では、定数としてシンボリックな名前 LINUX_REBOOT_* が定義されており、呼び出しの第 4 引数として 指定することができる。*/ .sp .B #include .br .B #include .sp .BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg ); .sp .\"O /* Under glibc some of the constants involved have gotten .\"O symbolic names RB_*, and the library call is a 1-argument .\"O wrapper around the 3-argument system call: /* glibc では、関連する定数に RB_* というシンボリックな名前が付け られている。ライブラリ関数の引数は 1 つで、3 引数のシステムコールの ラッパ (wrapper) となっている。 */ .sp .B #include .br .B #include .sp .BI "int reboot(int " cmd ); .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR reboot () .\"O call reboots the system, or enables/disables the reboot keystroke .\"O (abbreviated CAD, since the default is Ctrl-Alt-Delete; .\"O it can be changed using .\"O .BR loadkeys (1)). .BR reboot () はシステムを再起動する。または再起動のキーストロークである Ctrl-Alt-Delete (CAD) を有効/無効にする。 このキーストロークは .BR loadkeys (1) によって変更できる。 .PP .\"O This system call will fail (with .\"O .BR EINVAL ) .\"O unless .\"O .I magic .\"O equals .\"O .B LINUX_REBOOT_MAGIC1 .\"O (that is, 0xfee1dead) and .\"O .I magic2 .\"O equals .\"O .B LINUX_REBOOT_MAGIC2 .\"O (that is, 672274793). .\"O However, since 2.1.17 also .\"O .B LINUX_REBOOT_MAGIC2A .\"O (that is, 85072278) .\"O and since 2.1.97 also .\"O .B LINUX_REBOOT_MAGIC2B .\"O (that is, 369367448) .\"O and since 2.5.71 also .\"O .B LINUX_REBOOT_MAGIC2C .\"O (that is, 537993216) .\"O are permitted as value for .\"O .IR magic2 . .\"O (The hexadecimal values of these constants are meaningful.) .\"O The .\"O .I cmd .\"O argument can have the following values: .I magic が .B LINUX_REBOOT_MAGIC1 (値は 0xfee1dead) であり、かつ .I magic2 が .B LINUX_REBOOT_MAGIC2 (672274793) でなければこのシステムコールは失敗し、 .B EINVAL が返される。 しかし 2.1.17 からは .B LINUX_REBOOT_MAGIC2A (85072278) が、 また 2.1.97 からは .B LINUX_REBOOT_MAGIC2B (369367448) が、 2.5.71 からは .B LINUX_REBOOT_MAGIC2C (537993216) が .I magic2 の値として指定できるようになった (これらの定数の 16 進での 表記にはちょっとした意味がある)。 .I cmd 引数には以下の値を指定できる。 .TP .B LINUX_REBOOT_CMD_RESTART (RB_AUTOBOOT, 0x1234567) .\"O The message "Restarting system." is printed, and a default .\"O restart is performed immediately. .\"O If not preceded by a .\"O .BR sync (2), .\"O data will be lost. "Restarting system." というメッセージが表示され、 デフォルトの再起動処理がただちに実行される。 先に .BR sync (2) を行なわないと、データが失われる。 .TP .B LINUX_REBOOT_CMD_HALT .\"O (RB_HALT_SYSTEM, 0xcdef0123; since 1.1.76). .\"O The message "System halted." is printed, and the system is halted. .\"O Control is given to the ROM monitor, if there is one. .\"O If not preceded by a .\"O .BR sync (2), .\"O data will be lost. (RB_HALT_SYSTEM, 0xcdef0123; 1.1.76 以降) "System halted." というメッセージが表示され、システムは停止 (halt) する。 制御は ROM モニタに移る (ROM モニタがある場合)。 先に .BR sync (2) を行なわないと、データが失われる。 .TP .B LINUX_REBOOT_CMD_POWER_OFF .\"O (0x4321fedc; since 2.1.30). .\"O The message "Power down." is printed, the system is stopped, .\"O and all power is removed from the system, if possible. .\"O If not preceded by a .\"O .BR sync (2), .\"O data will be lost. (0x4321fedc; 2.1.30 以降) "Power down" というメッセージが表示され、システムは停止 (stop) する。 可能な場合はシステムの電源が落とされる。 先に .BR sync (2) を行なわないと、データが失われる。 .TP .B LINUX_REBOOT_CMD_RESTART2 .\"O (0xa1b2c3d4; since 2.1.30). .\"O The message "Restarting system with command \(aq%s\(aq" is printed, .\"O and a restart (using the command string given in .\"O .IR arg ) .\"O is performed immediately. .\"O If not preceded by a .\"O .BR sync (2), .\"O data will be lost. (0xa1b2c3d4; 2.1.30 以降) "Restarting system with command \(aq%s\(aq" というメッセージが表示され、 ただちに ( .I arg に指定されたコマンドを用いて) 再起動 (restart) が行われる。 先に .BR sync (2) を行なわないと、データが失われる。 .TP .B LINUX_REBOOT_CMD_CAD_ON .\"O (RB_ENABLE_CAD, 0x89abcdef). .\"O CAD is enabled. .\"O This means that the CAD keystroke will immediately cause .\"O the action associated with .\"O .BR LINUX_REBOOT_CMD_RESTART . (RB_ENABLE_CAD, 0x89abcdef) CAD を有効にする。 これ以降に CAD キーストロークが入力されると、 ただちに .B LINUX_REBOOT_CMD_RESTART に関連付けられた動作が行われるようになる。 .TP .B LINUX_REBOOT_CMD_CAD_OFF .\"O (RB_DISABLE_CAD, 0). .\"O CAD is disabled. .\"O This means that the CAD keystroke will cause a .\"O .B SIGINT .\"O signal to be .\"O sent to init (process 1), whereupon this process may decide upon a .\"O proper action (maybe: kill all processes, sync, reboot). (RB_DISABLE_CAD, 0) CAD を無効にする。 これ以降に CAD キーストロークが入力されると、 .B SIGINT シグナルが init (プロセス 1) に送られる。 このシグナルを受けると、おそらく init プロセスは 前もって定められた動作を行うことになる (多分すべてのプロセスの kill, sync, 再起動)。 .LP .\"O Only the superuser may call .\"O .BR reboot (). スーパーユーザーだけが .BR reboot () を呼び出すことができる。 .LP .\"O The precise effect of the above actions depends on the architecture. .\"O For the i386 architecture, the additional argument does not do .\"O anything at present (2.1.122), but the type of reboot can be .\"O determined by kernel command-line arguments ("reboot=...") to be .\"O either warm or cold, and either hard or through the BIOS. 上述のアクションの実際の効果はアーキテクチャに依存する。 i386 アーキテクチャでは、現在のところ (2.1.122) 付加引数は 何も行わないが、再起動のタイプをカーネルのコマンドライン引数 ("reboot=...") によって定めることができる。 これには warm または cold と、 hard または BIOS 経由の再起動を 設定できる。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O For the values of .\"O .I cmd .\"O that stop or restart the system, .\"O a successful call to .\"O .BR reboot () .\"O does not return. .\"O For the other .\"O .I cmd .\"O values, zero is returned on success. .\"O In all cases, \-1 is returned on failure, and .\"O .I errno .\"O is set appropriately. .I cmd がシステムの停止や再起動を表す値の場合、呼び出しが成功すると .BR reboot () は返らない。 .I cmd が他の値の場合には、成功すると 0 が返る。 .I cmd の値に関わらず、失敗の場合には \-1 が返り、 .I errno が適切に設定される。 .\"O .SH ERRORS .SH エラー .TP .B EFAULT .\"O Problem with getting userspace data under .\"O .BR LINUX_REBOOT_CMD_RESTART2 . .B LINUX_REBOOT_CMD_RESTART2 の時にユーザースペースのデータの取得に問題があった。 .TP .B EINVAL .\"O Bad magic numbers or \fIcmd\fP. magic の数字か \fIcmd\fP が間違っている。 .TP .B EPERM .\"O The calling process has insufficient privilege to call .\"O .BR reboot (); .\"O the .\"O .B CAP_SYS_BOOT .\"O capability is required. 呼び出し元プロセスに .BR reboot () を呼び出すのに十分な権限がなかった。 .B CAP_SYS_BOOT ケーパビリティが必要である。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O .BR reboot () .\"O is Linux-specific, .\"O and should not be used in programs intended to be portable. .BR reboot () は Linux に特有であり、移植を考慮したプログラムでは用いるべきではない。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR sync (2), .BR bootparam (7), .BR ctrlaltdel (8), .BR halt (8), .BR reboot (8), .BR capabilities (7)