]>
Commit | Line | Data |
---|---|---|
a1eaacb1 | 1 | '\" t |
fea681da MK |
2 | .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. |
3 | .\" | |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
fea681da MK |
5 | .\" |
6 | .\" Modified Tue Oct 22 22:11:53 1996 by Eric S. Raymond <esr@thyrsus.com> | |
4c1c5274 | 7 | .TH socketcall 2 (date) "Linux man-pages (unreleased)" |
fea681da MK |
8 | .SH NAME |
9 | socketcall \- socket system calls | |
4b0ab5ad AC |
10 | .SH LIBRARY |
11 | Standard C library | |
8fc3b2cf | 12 | .RI ( libc ", " \-lc ) |
fea681da | 13 | .SH SYNOPSIS |
c7db92b9 | 14 | .nf |
b6687e39 AC |
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> | |
c6d039a3 | 18 | .P |
b6687e39 | 19 | .BI "int syscall(SYS_socketcall, int " call ", unsigned long *" args ); |
c7db92b9 | 20 | .fi |
c6d039a3 | 21 | .P |
fa50e159 | 22 | .IR Note : |
b6687e39 AC |
23 | glibc provides no wrapper for |
24 | .BR socketcall (), | |
25 | necessitating the use of | |
26 | .BR syscall (2). | |
fea681da | 27 | .SH DESCRIPTION |
e511ffb6 | 28 | .BR socketcall () |
fea681da MK |
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. | |
c6d039a3 | 35 | .P |
fea681da MK |
36 | User programs should call the appropriate functions by their usual names. |
37 | Only standard library implementors and kernel hackers need to know about | |
e511ffb6 | 38 | .BR socketcall (). |
c6d039a3 | 39 | .P |
f576fff5 MF |
40 | .TS |
41 | tab(:); | |
42 | l l. | |
43 | \fIcall\fR:Man page | |
44 | T{ | |
45 | .B SYS_SOCKET | |
46 | T}:T{ | |
47 | .BR socket (2) | |
48 | T} | |
49 | T{ | |
50 | .B SYS_BIND | |
51 | T}:T{ | |
52 | .BR bind (2) | |
53 | T} | |
54 | T{ | |
55 | .B SYS_CONNECT | |
56 | T}:T{ | |
57 | .BR connect (2) | |
58 | T} | |
59 | T{ | |
60 | .B SYS_LISTEN | |
61 | T}:T{ | |
62 | .BR listen (2) | |
63 | T} | |
64 | T{ | |
65 | .B SYS_ACCEPT | |
66 | T}:T{ | |
67 | .BR accept (2) | |
68 | T} | |
69 | T{ | |
70 | .B SYS_GETSOCKNAME | |
71 | T}:T{ | |
72 | .BR getsockname (2) | |
73 | T} | |
74 | T{ | |
75 | .B SYS_GETPEERNAME | |
76 | T}:T{ | |
77 | .BR getpeername (2) | |
78 | T} | |
79 | T{ | |
80 | .B SYS_SOCKETPAIR | |
81 | T}:T{ | |
82 | .BR socketpair (2) | |
83 | T} | |
84 | T{ | |
85 | .B SYS_SEND | |
86 | T}:T{ | |
87 | .BR send (2) | |
88 | T} | |
89 | T{ | |
90 | .B SYS_RECV | |
91 | T}:T{ | |
92 | .BR recv (2) | |
93 | T} | |
94 | T{ | |
95 | .B SYS_SENDTO | |
96 | T}:T{ | |
97 | .BR sendto (2) | |
98 | T} | |
99 | T{ | |
100 | .B SYS_RECVFROM | |
101 | T}:T{ | |
102 | .BR recvfrom (2) | |
103 | T} | |
104 | T{ | |
105 | .B SYS_SHUTDOWN | |
106 | T}:T{ | |
107 | .BR shutdown (2) | |
108 | T} | |
109 | T{ | |
110 | .B SYS_SETSOCKOPT | |
111 | T}:T{ | |
112 | .BR setsockopt (2) | |
113 | T} | |
114 | T{ | |
115 | .B SYS_GETSOCKOPT | |
116 | T}:T{ | |
117 | .BR getsockopt (2) | |
118 | T} | |
119 | T{ | |
120 | .B SYS_SENDMSG | |
121 | T}:T{ | |
122 | .BR sendmsg (2) | |
123 | T} | |
124 | T{ | |
125 | .B SYS_RECVMSG | |
126 | T}:T{ | |
127 | .BR recvmsg (2) | |
128 | T} | |
129 | T{ | |
130 | .B SYS_ACCEPT4 | |
131 | T}:T{ | |
132 | .BR accept4 (2) | |
133 | T} | |
134 | T{ | |
135 | .B SYS_RECVMMSG | |
136 | T}:T{ | |
137 | .BR recvmmsg (2) | |
138 | T} | |
139 | T{ | |
140 | .B SYS_SENDMMSG | |
141 | T}:T{ | |
142 | .BR sendmmsg (2) | |
143 | T} | |
144 | .TE | |
4131356c | 145 | .SH VERSIONS |
36546c38 | 146 | On some architectures\[em]for example, x86-64 and ARM\[em]there is no |
bf25f45c MK |
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. | |
4131356c AC |
153 | .SH STANDARDS |
154 | Linux. | |
c6d039a3 | 155 | .P |
b08d144c MK |
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. | |
47297adb | 168 | .SH SEE ALSO |
fea681da MK |
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), | |
ed2a6c73 | 178 | .BR recvmsg (2), |
fea681da | 179 | .BR send (2), |
ed2a6c73 | 180 | .BR sendmsg (2), |
f0c34053 | 181 | .BR sendto (2), |
fea681da MK |
182 | .BR setsockopt (2), |
183 | .BR shutdown (2), | |
184 | .BR socket (2), | |
185 | .BR socketpair (2) |