socketcall.2: Use syscall(SYS_...); for system calls without a wrapper

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-05-24 20:19:47 +02:00 committed by Michael Kerrisk
parent 1b4d275a0e
commit b6687e3971
1 changed files with 9 additions and 7 deletions

View File

@ -27,13 +27,18 @@
socketcall \- socket system calls
.SH SYNOPSIS
.nf
.B #include <linux/net.h>
.BR "#include <linux/net.h>" " /* Definition of " SYS_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_socketcall " */"
.B #include <unistd.h>
.PP
.BI "int socketcall(int " call ", unsigned long *" args );
.BI "int syscall(SYS_socketcall, int " call ", unsigned long *" args );
.fi
.PP
.IR Note :
There is no glibc wrapper for this system call; see NOTES.
glibc provides no wrapper for
.BR socketcall (),
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION
.BR socketcall ()
is a common kernel entry point for the socket system calls.
@ -156,10 +161,6 @@ T}
This call is specific to Linux, and should not be used in programs
intended to be portable.
.SH NOTES
Glibc does not provide a wrapper for this system call;
in the unlikely event that you want to call it directly, do so using
.BR syscall (2).
.PP
On some architectures\(emfor example, x86-64 and ARM\(emthere is no
.BR socketcall ()
system call; instead
@ -198,3 +199,4 @@ and also provides a (very) small performance improvement.
.BR shutdown (2),
.BR socket (2),
.BR socketpair (2)