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>
.\" 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
reboot \- reboot or enable/disable Ctrl-Alt-Del
.SH SYNOPSIS
@ -35,7 +35,7 @@ reboot \- reboot or enable/disable Ctrl-Alt-Del
.br
.B #include <linux/reboot.h>
.sp
.BI "int reboot(int " magic ", int " magic2 ", int " flag ", void *" arg );
.BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
.sp
/* Under glibc some of the constants involved have gotten
symbolic names RB_*, and the library call is a 1-argument
@ -45,7 +45,7 @@ reboot \- reboot or enable/disable Ctrl-Alt-Del
.br
.B #include <sys/reboot.h>
.sp
.BI "int reboot(int " flag );
.BI "int reboot(int " cmd );
.SH DESCRIPTION
The
.BR reboot ()
@ -78,7 +78,7 @@ are permitted as value for
.IR magic2 .
(The hexadecimal values of these constants are meaningful.)
The
.I flag
.I cmd
argument can have the following values:
.TP
.B LINUX_REBOOT_CMD_RESTART
@ -131,7 +131,8 @@ signal to be
sent to init (process 1), whereupon this process may decide upon a
proper action (maybe: kill all processes, sync, reboot).
.LP
Only the superuser may use this function.
Only the superuser may call
.BR reboot ().
.LP
The precise effect of the above actions depends on the architecture.
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
either warm or cold, and either hard or through the BIOS.
.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, and
For the values of
.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
is set appropriately.
.SH ERRORS
@ -150,7 +159,7 @@ Problem with getting userspace data under
.BR LINUX_REBOOT_CMD_RESTART2 .
.TP
.B EINVAL
Bad magic numbers or \fIflag\fP.
Bad magic numbers or \fIcmd\fP.
.TP
.B EPERM
The calling process has insufficient privilege to call