summaryrefslogtreecommitdiffstats
path: root/man2/reboot.2
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:41:07 +0000
commit3af6d22bb3850ab2bac67287e3a3d3b0e32868e5 (patch)
tree3ee7a3ec64525911fa865bb984c86d997d855527 /man2/reboot.2
parentAdding debian version 6.05.01-1. (diff)
downloadmanpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.tar.xz
manpages-3af6d22bb3850ab2bac67287e3a3d3b0e32868e5.zip
Merging upstream version 6.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--man2/reboot.251
1 files changed, 28 insertions, 23 deletions
diff --git a/man2/reboot.2 b/man2/reboot.2
index 681087f..7ca639c 100644
--- a/man2/reboot.2
+++ b/man2/reboot.2
@@ -5,7 +5,7 @@
.\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
.\" Added notes on capability requirements
.\"
-.TH reboot 2 2023-03-30 "Linux man-pages 6.05.01"
+.TH reboot 2 2024-03-03 "Linux man-pages 6.7"
.SH NAME
reboot \- reboot or enable/disable Ctrl-Alt-Del
.SH LIBRARY
@@ -15,23 +15,23 @@ Standard C library
.nf
.RB "/* Since Linux 2.1.30 there are symbolic names " LINUX_REBOOT_*
for the constants and a fourth argument to the call: */
-.PP
+.P
.BR "#include <linux/reboot.h> " \
"/* Definition of " LINUX_REBOOT_* " constants */"
.BR "#include <sys/syscall.h> " "/* Definition of " SYS_* " constants */"
.B #include <unistd.h>
-.PP
-.BI "int syscall(SYS_reboot, int " magic ", int " magic2 ", int " cmd ", void *" arg );
-.PP
+.P
+.BI "int syscall(SYS_reboot, int " magic ", int " magic2 ", int " op ", void *" arg );
+.P
/* Under glibc and most alternative libc's (including uclibc, dietlibc,
musl and a few others), some of the constants involved have gotten
.RB " symbolic names " RB_* ", and the library call is a 1-argument"
wrapper around the system call: */
-.PP
+.P
.BR "#include <sys/reboot.h> " "/* Definition of " RB_* " constants */"
.B #include <unistd.h>
-.PP
-.BI "int reboot(int " cmd );
+.P
+.BI "int reboot(int " op );
.fi
.SH DESCRIPTION
The
@@ -40,7 +40,7 @@ call reboots the system, or enables/disables the reboot keystroke
(abbreviated CAD, since the default is Ctrl-Alt-Delete;
it can be changed using
.BR loadkeys (1)).
-.PP
+.P
This system call fails (with the error
.BR EINVAL )
unless
@@ -64,9 +64,9 @@ and since Linux 2.5.71 also
are permitted as values for
.IR magic2 .
(The hexadecimal values of these constants are meaningful.)
-.PP
+.P
The
-.I cmd
+.I op
argument can have the following values:
.TP
.B LINUX_REBOOT_CMD_CAD_OFF
@@ -138,10 +138,10 @@ data will be lost.
The system is suspended (hibernated) to disk.
This option is available only if the kernel was configured with
.BR CONFIG_HIBERNATION .
-.PP
+.P
Only the superuser may call
.BR reboot ().
-.PP
+.P
The precise effect of the above actions depends on the architecture.
For the i386 architecture, the additional argument does not do
anything at present (2.1.122), but the type of reboot can be
@@ -157,20 +157,22 @@ if
is called
from a PID namespace other than the initial PID namespace
with one of the
-.I cmd
+.I op
values listed below,
it performs a "reboot" of that namespace:
the "init" process of the PID namespace is immediately terminated,
with the effects described in
.BR pid_namespaces (7).
-.PP
+.P
The values that can be supplied in
-.I cmd
+.I op
when calling
.BR reboot ()
in this case are as follows:
.TP
-.BR LINUX_REBOOT_CMD_RESTART ", " LINUX_REBOOT_CMD_RESTART2
+.B LINUX_REBOOT_CMD_RESTART
+.TQ
+.B LINUX_REBOOT_CMD_RESTART2
The "init" process is terminated,
and
.BR wait (2)
@@ -178,16 +180,18 @@ in the parent process reports that the child was killed with a
.B SIGHUP
signal.
.TP
-.BR LINUX_REBOOT_CMD_POWER_OFF ", " LINUX_REBOOT_CMD_HALT
+.B LINUX_REBOOT_CMD_POWER_OFF
+.TQ
+.B LINUX_REBOOT_CMD_HALT
The "init" process is terminated,
and
.BR wait (2)
in the parent process reports that the child was killed with a
.B SIGINT
signal.
-.PP
+.P
For the other
-.I cmd
+.I op
values,
.BR reboot ()
returns \-1 and
@@ -196,13 +200,13 @@ is set to
.BR EINVAL .
.SH RETURN VALUE
For the values of
-.I cmd
+.I op
that stop or restart the system,
a successful call to
.BR reboot ()
does not return.
For the other
-.I cmd
+.I op
values, zero is returned on success.
In all cases, \-1 is returned on failure, and
.I errno
@@ -214,7 +218,8 @@ Problem with getting user-space data under
.BR LINUX_REBOOT_CMD_RESTART2 .
.TP
.B EINVAL
-Bad magic numbers or \fIcmd\fP.
+Bad magic numbers or
+.IR op .
.TP
.B EPERM
The calling process has insufficient privilege to call