Fix RETURN VALUE description: in some cases reboot() does not return.

Rename the 'flag' argument to 'cmd', since that is more meaningful,
and also what is used in the kernel source.
Other minor wording changes.
This commit is contained in:
Michael Kerrisk 2008-02-11 10:05:05 +00:00
parent 21a0b03de8
commit 350d584d17
1 changed files with 17 additions and 8 deletions

View File

@ -22,7 +22,7 @@
.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com> .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
.\" Added notes on capability requirements .\" Added notes on capability requirements
.\" .\"
.TH REBOOT 2 2004-05-27 "Linux" "Linux Programmer's Manual" .TH REBOOT 2 2007-02-11 "Linux" "Linux Programmer's Manual"
.SH NAME .SH NAME
reboot \- reboot or enable/disable Ctrl-Alt-Del reboot \- reboot or enable/disable Ctrl-Alt-Del
.SH SYNOPSIS .SH SYNOPSIS
@ -35,7 +35,7 @@ reboot \- reboot or enable/disable Ctrl-Alt-Del
.br .br
.B #include <linux/reboot.h> .B #include <linux/reboot.h>
.sp .sp
.BI "int reboot(int " magic ", int " magic2 ", int " flag ", void *" arg ); .BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
.sp .sp
/* Under glibc some of the constants involved have gotten /* Under glibc some of the constants involved have gotten
symbolic names RB_*, and the library call is a 1-argument symbolic names RB_*, and the library call is a 1-argument
@ -45,7 +45,7 @@ reboot \- reboot or enable/disable Ctrl-Alt-Del
.br .br
.B #include <sys/reboot.h> .B #include <sys/reboot.h>
.sp .sp
.BI "int reboot(int " flag ); .BI "int reboot(int " cmd );
.SH DESCRIPTION .SH DESCRIPTION
The The
.BR reboot () .BR reboot ()
@ -78,7 +78,7 @@ are permitted as value for
.IR magic2 . .IR magic2 .
(The hexadecimal values of these constants are meaningful.) (The hexadecimal values of these constants are meaningful.)
The The
.I flag .I cmd
argument can have the following values: argument can have the following values:
.TP .TP
.B LINUX_REBOOT_CMD_RESTART .B LINUX_REBOOT_CMD_RESTART
@ -131,7 +131,8 @@ signal to be
sent to init (process 1), whereupon this process may decide upon a sent to init (process 1), whereupon this process may decide upon a
proper action (maybe: kill all processes, sync, reboot). proper action (maybe: kill all processes, sync, reboot).
.LP .LP
Only the superuser may use this function. Only the superuser may call
.BR reboot ().
.LP .LP
The precise effect of the above actions depends on the architecture. The precise effect of the above actions depends on the architecture.
For the i386 architecture, the additional argument does not do For the i386 architecture, the additional argument does not do
@ -139,8 +140,16 @@ anything at present (2.1.122), but the type of reboot can be
determined by kernel command line arguments (`reboot=...') to be determined by kernel command line arguments (`reboot=...') to be
either warm or cold, and either hard or through the BIOS. either warm or cold, and either hard or through the BIOS.
.SH "RETURN VALUE" .SH "RETURN VALUE"
On success, zero is returned. For the values of
On error, \-1 is returned, and .I cmd
that stop or restart the system,
a successful call to
.BR reboot ()
does not return.
For the other
.I cmd
values, zero is returned on success.
In all cases, \-1 is returned on failure, and
.I errno .I errno
is set appropriately. is set appropriately.
.SH ERRORS .SH ERRORS
@ -150,7 +159,7 @@ Problem with getting userspace data under
.BR LINUX_REBOOT_CMD_RESTART2 . .BR LINUX_REBOOT_CMD_RESTART2 .
.TP .TP
.B EINVAL .B EINVAL
Bad magic numbers or \fIflag\fP. Bad magic numbers or \fIcmd\fP.
.TP .TP
.B EPERM .B EPERM
The calling process has insufficient privilege to call The calling process has insufficient privilege to call