1SOCKETCALL(2)              Linux Programmer's Manual             SOCKETCALL(2)
2
3
4

NAME

6       socketcall - socket system calls
7

SYNOPSIS

9       #include <linux/net.h>
10
11       int socketcall(int call, unsigned long *args);
12

DESCRIPTION

14       socketcall()  is  a  common  kernel  entry  point for the socket system
15       calls.  call determines which socket function to invoke.   args  points
16       to a block containing the actual arguments, which are passed through to
17       the appropriate call.
18
19       User programs should call the  appropriate  functions  by  their  usual
20       names.   Only  standard library implementors and kernel hackers need to
21       know about socketcall().
22
23       call              Man page
24       SYS_SOCKET        socket(2)
25       SYS_BIND          bind(2)
26       SYS_CONNECT       connect(2)
27       SYS_LISTEN        listen(2)
28       SYS_ACCEPT        accept(2)
29       SYS_GETSOCKNAME   getsockname(2)
30       SYS_GETPEERNAME   getpeername(2)
31       SYS_SOCKETPAIR    socketpair(2)
32       SYS_SEND          send(2)
33       SYS_RECV          recv(2)
34       SYS_SENDTO        sendto(2)
35       SYS_RECVFROM      recvfrom(2)
36       SYS_SHUTDOWN      shutdown(2)
37       SYS_SETSOCKOPT    setsockopt(2)
38       SYS_GETSOCKOPT    getsockopt(2)
39       SYS_SENDMSG       sendmsg(2)
40       SYS_RECVMSG       recvmsg(2)
41       SYS_ACCEPT4       accept4(2)
42       SYS_RECVMMSG      recvmmsg(2)
43       SYS_SENDMMSG      sendmmsg(2)
44

CONFORMING TO

46       This call is specific to Linux, and should  not  be  used  in  programs
47       intended to be portable.
48

NOTES

50       On a some architectures—for example, x86-64 and ARM—there is no socket‐
51       call() system call; instead socket(2), accept(2), bind(2),  and  so  on
52       really are implemented as separate system calls.
53
54       On  x86-32,  socketcall() was historically the only entry point for the
55       sockets API.  However, starting in Linux 4.3, direct system  calls  are
56       provided  on x86-32 for the sockets API.  This facilitates the creation
57       of seccomp(2) filters that filter sockets system calls (for  new  user-
58       space  binaries that are compiled to use the new entry points) and also
59       provides a (very) small performance improvement.
60

SEE ALSO

62       accept(2), bind(2), connect(2),  getpeername(2),  getsockname(2),  get‐
63       sockopt(2),   listen(2),  recv(2),  recvfrom(2),  recvmsg(2),  send(2),
64       sendmsg(2), sendto(2), setsockopt(2), shutdown(2),  socket(2),  socket‐
65       pair(2)
66

COLOPHON

68       This  page  is  part of release 5.07 of the Linux man-pages project.  A
69       description of the project, information about reporting bugs,  and  the
70       latest     version     of     this    page,    can    be    found    at
71       https://www.kernel.org/doc/man-pages/.
72
73
74
75Linux                             2017-09-15                     SOCKETCALL(2)
Impressum