man-pages/man2/socketcall.2.html
2021-03-31 01:06:50 +01:00

291 lines
6.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SOCKETCALL</TITLE>
</HEAD><BODY>
<H1>SOCKETCALL</H1>
Section: Linux Programmer's Manual (2)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
socketcall - socket system calls
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>#include &lt;<A HREF="file:///usr/include/linux/net.h">linux/net.h</A>&gt;</B>
<P>
<B>int socketcall(int </B><I>call</I><B>, unsigned long *</B><I>args</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>socketcall</B>()
is a common kernel entry point for the socket system calls.
<I>call</I>
determines which socket function to invoke.
<I>args</I>
points to a block containing the actual arguments,
which are passed through to the appropriate call.
<P>
User programs should call the appropriate functions by their usual names.
Only standard library implementors and kernel hackers need to know about
<B>socketcall</B>().
<P>
<TABLE>
<TR VALIGN=top><TD><I>call</I></TD><TD>Man page<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SOCKET</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+socket">socket</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_BIND</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+bind">bind</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_CONNECT</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+connect">connect</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_LISTEN</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+listen">listen</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_ACCEPT</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+accept">accept</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_GETSOCKNAME</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+getsockname">getsockname</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_GETPEERNAME</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+getpeername">getpeername</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SOCKETPAIR</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+socketpair">socketpair</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SEND</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+send">send</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_RECV</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+recv">recv</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SENDTO</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+sendto">sendto</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_RECVFROM</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+recvfrom">recvfrom</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SHUTDOWN</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+shutdown">shutdown</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SETSOCKOPT</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+setsockopt">setsockopt</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_GETSOCKOPT</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+getsockopt">getsockopt</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SENDMSG</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+sendmsg">sendmsg</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_RECVMSG</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+recvmsg">recvmsg</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_ACCEPT4</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+accept4">accept4</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_RECVMMSG</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+recvmmsg">recvmmsg</A></B>(2)
<BR></TD></TR>
<TR VALIGN=top><TD>
<B>SYS_SENDMMSG</B>
</TD><TD>
<B><A HREF="/cgi-bin/man/man2html?2+sendmmsg">sendmmsg</A></B>(2)
<BR></TD></TR>
</TABLE>
<A NAME="lbAE">&nbsp;</A>
<H2>CONFORMING TO</H2>
This call is specific to Linux, and should not be used in programs
intended to be portable.
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
On a some architectures---for example, x86-64 and ARM---there is no
<B>socketcall</B>()
system call; instead
<B><A HREF="/cgi-bin/man/man2html?2+socket">socket</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+accept">accept</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+bind">bind</A></B>(2),
and so on really are implemented as separate system calls.
<P>
On x86-32,
<B>socketcall</B>()
was historically the only entry point for the sockets API.
However, starting in Linux 4.3,
direct system calls are provided on x86-32 for the sockets API.
This facilitates the creation of
<B><A HREF="/cgi-bin/man/man2html?2+seccomp">seccomp</A></B>(2)
filters that filter sockets system calls
(for new user-space binaries that are compiled
to use the new entry points)
and also provides a (very) small performance improvement.
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?2+accept">accept</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+bind">bind</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+connect">connect</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+getpeername">getpeername</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+getsockname">getsockname</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+getsockopt">getsockopt</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+listen">listen</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+recv">recv</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+recvfrom">recvfrom</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+recvmsg">recvmsg</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+send">send</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+sendmsg">sendmsg</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+sendto">sendto</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+setsockopt">setsockopt</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+shutdown">shutdown</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+socket">socket</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+socketpair">socketpair</A></B>(2)
<A NAME="lbAH">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="4"><A HREF="#lbAE">CONFORMING TO</A><DD>
<DT id="5"><A HREF="#lbAF">NOTES</A><DD>
<DT id="6"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="7"><A HREF="#lbAH">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:34 GMT, March 31, 2021
</BODY>
</HTML>