mirror of https://github.com/mkerrisk/man-pages
reboot.2: Use syscall(SYS_...); for system calls without a wrapper
Explain also why headers are needed. And some ffix. Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
71b08c22b5
commit
fac7dabcd1
|
@ -30,21 +30,23 @@
|
|||
reboot \- reboot or enable/disable Ctrl-Alt-Del
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
/* Since kernel version 2.1.30 there are symbolic names LINUX_REBOOT_*
|
||||
.RB "/* Since kernel version 2.1.30 there are symbolic names " LINUX_REBOOT_*
|
||||
for the constants and a fourth argument to the call: */
|
||||
.PP
|
||||
.BR "#include <linux/reboot.h> " \
|
||||
"/* Definition of " LINUX_REBOOT_* " constants */"
|
||||
.BR "#include <sys/syscall.h> " "/* Definition of " SYS_* " constants */"
|
||||
.B #include <unistd.h>
|
||||
.B #include <linux/reboot.h>
|
||||
.PP
|
||||
.BI "int reboot(int " magic ", int " magic2 ", int " cmd ", void *" arg );
|
||||
.BI "int syscall(SYS_reboot, int " magic ", int " magic2 ", int " cmd ", void *" arg );
|
||||
.PP
|
||||
/* Under glibc and most alternative libc's (including uclibc, dietlibc,
|
||||
musl and a few others), some of the constants involved have gotten
|
||||
symbolic names RB_*, and the library call is a 1-argument
|
||||
.RB " symbolic names " RB_* ", and the library call is a 1-argument"
|
||||
wrapper around the system call: */
|
||||
.PP
|
||||
.BR "#include <sys/reboot.h> " "/* Definition of " RB_* " constants */"
|
||||
.B #include <unistd.h>
|
||||
.B #include <sys/reboot.h>
|
||||
.PP
|
||||
.BI "int reboot(int " cmd );
|
||||
.fi
|
||||
|
|
Loading…
Reference in New Issue