Changes.old: tfix
[man-pages.git] / man2 / socketcall.2
blob086ed6bdbbad3c635b95f39b5772162d50b13b81
1 '\" t
2 .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995.
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" Modified Tue Oct 22 22:11:53 1996 by Eric S. Raymond <esr@thyrsus.com>
7 .TH socketcall 2 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 socketcall \- socket system calls
10 .SH LIBRARY
11 Standard C library
12 .RI ( libc ", " \-lc )
13 .SH SYNOPSIS
14 .nf
15 .BR "#include <linux/net.h>" "        /* Definition of " SYS_* " constants */"
16 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_socketcall " */"
17 .B #include <unistd.h>
19 .BI "int syscall(SYS_socketcall, int " call ", unsigned long *" args );
20 .fi
22 .IR Note :
23 glibc provides no wrapper for
24 .BR socketcall (),
25 necessitating the use of
26 .BR syscall (2).
27 .SH DESCRIPTION
28 .BR socketcall ()
29 is a common kernel entry point for the socket system calls.
30 .I call
31 determines which socket function to invoke.
32 .I args
33 points to a block containing the actual arguments,
34 which are passed through to the appropriate call.
36 User programs should call the appropriate functions by their usual names.
37 Only standard library implementors and kernel hackers need to know about
38 .BR socketcall ().
40 .TS
41 tab(:);
42 l l.
43 \fIcall\fR:Man page
45 .B SYS_SOCKET
46 T}:T{
47 .BR socket (2)
50 .B SYS_BIND
51 T}:T{
52 .BR bind (2)
55 .B SYS_CONNECT
56 T}:T{
57 .BR connect (2)
60 .B SYS_LISTEN
61 T}:T{
62 .BR listen (2)
65 .B SYS_ACCEPT
66 T}:T{
67 .BR accept (2)
70 .B SYS_GETSOCKNAME
71 T}:T{
72 .BR getsockname (2)
75 .B SYS_GETPEERNAME
76 T}:T{
77 .BR getpeername (2)
80 .B SYS_SOCKETPAIR
81 T}:T{
82 .BR socketpair (2)
85 .B SYS_SEND
86 T}:T{
87 .BR send (2)
90 .B SYS_RECV
91 T}:T{
92 .BR recv (2)
95 .B SYS_SENDTO
96 T}:T{
97 .BR sendto (2)
100 .B SYS_RECVFROM
101 T}:T{
102 .BR recvfrom (2)
105 .B SYS_SHUTDOWN
106 T}:T{
107 .BR shutdown (2)
110 .B SYS_SETSOCKOPT
111 T}:T{
112 .BR setsockopt (2)
115 .B SYS_GETSOCKOPT
116 T}:T{
117 .BR getsockopt (2)
120 .B SYS_SENDMSG
121 T}:T{
122 .BR sendmsg (2)
125 .B SYS_RECVMSG
126 T}:T{
127 .BR recvmsg (2)
130 .B SYS_ACCEPT4
131 T}:T{
132 .BR accept4 (2)
135 .B SYS_RECVMMSG
136 T}:T{
137 .BR recvmmsg (2)
140 .B SYS_SENDMMSG
141 T}:T{
142 .BR sendmmsg (2)
145 .SH VERSIONS
146 On some architectures\[em]for example, x86-64 and ARM\[em]there is no
147 .BR socketcall ()
148 system call; instead
149 .BR socket (2),
150 .BR accept (2),
151 .BR bind (2),
152 and so on really are implemented as separate system calls.
153 .SH STANDARDS
154 Linux.
156 On x86-32,
157 .BR socketcall ()
158 was historically the only entry point for the sockets API.
159 However, starting in Linux 4.3,
160 .\" commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb
161 direct system calls are provided on x86-32 for the sockets API.
162 This facilitates the creation of
163 .BR seccomp (2)
164 filters that filter sockets system calls
165 (for new user-space binaries that are compiled
166 to use the new entry points)
167 and also provides a (very) small performance improvement.
168 .SH SEE ALSO
169 .BR accept (2),
170 .BR bind (2),
171 .BR connect (2),
172 .BR getpeername (2),
173 .BR getsockname (2),
174 .BR getsockopt (2),
175 .BR listen (2),
176 .BR recv (2),
177 .BR recvfrom (2),
178 .BR recvmsg (2),
179 .BR send (2),
180 .BR sendmsg (2),
181 .BR sendto (2),
182 .BR setsockopt (2),
183 .BR shutdown (2),
184 .BR socket (2),
185 .BR socketpair (2)