]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (c) 1995 Michael Chastain (mec@shell.portal.com), 15 April 1995. |
2 | .\" | |
1dd72f9c | 3 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
fea681da MK |
4 | .\" This is free documentation; you can redistribute it and/or |
5 | .\" modify it under the terms of the GNU General Public License as | |
6 | .\" published by the Free Software Foundation; either version 2 of | |
7 | .\" the License, or (at your option) any later version. | |
8 | .\" | |
9 | .\" The GNU General Public License's references to "object code" | |
10 | .\" and "executables" are to be interpreted as the output of any | |
11 | .\" document formatting or typesetting system, including | |
12 | .\" intermediate and printed output. | |
13 | .\" | |
14 | .\" This manual is distributed in the hope that it will be useful, | |
15 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | .\" GNU General Public License for more details. | |
18 | .\" | |
19 | .\" You should have received a copy of the GNU General Public | |
c715f741 MK |
20 | .\" License along with this manual; if not, see |
21 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 22 | .\" %%%LICENSE_END |
fea681da MK |
23 | .\" |
24 | .\" Modified Tue Oct 22 22:11:53 1996 by Eric S. Raymond <esr@thyrsus.com> | |
4b8c67d9 | 25 | .TH SOCKETCALL 2 2017-09-15 "Linux" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | socketcall \- socket system calls | |
28 | .SH SYNOPSIS | |
f576fff5 | 29 | .B #include <linux/net.h> |
68e4db0a | 30 | .PP |
cc40d64d | 31 | .BI "int socketcall(int " call ", unsigned long *" args ); |
fea681da | 32 | .SH DESCRIPTION |
e511ffb6 | 33 | .BR socketcall () |
fea681da MK |
34 | is a common kernel entry point for the socket system calls. |
35 | .I call | |
36 | determines which socket function to invoke. | |
37 | .I args | |
38 | points to a block containing the actual arguments, | |
39 | which are passed through to the appropriate call. | |
40 | .PP | |
41 | User programs should call the appropriate functions by their usual names. | |
42 | Only standard library implementors and kernel hackers need to know about | |
e511ffb6 | 43 | .BR socketcall (). |
f576fff5 MF |
44 | .PP |
45 | .TS | |
46 | tab(:); | |
47 | l l. | |
48 | \fIcall\fR:Man page | |
49 | T{ | |
50 | .B SYS_SOCKET | |
51 | T}:T{ | |
52 | .BR socket (2) | |
53 | T} | |
54 | T{ | |
55 | .B SYS_BIND | |
56 | T}:T{ | |
57 | .BR bind (2) | |
58 | T} | |
59 | T{ | |
60 | .B SYS_CONNECT | |
61 | T}:T{ | |
62 | .BR connect (2) | |
63 | T} | |
64 | T{ | |
65 | .B SYS_LISTEN | |
66 | T}:T{ | |
67 | .BR listen (2) | |
68 | T} | |
69 | T{ | |
70 | .B SYS_ACCEPT | |
71 | T}:T{ | |
72 | .BR accept (2) | |
73 | T} | |
74 | T{ | |
75 | .B SYS_GETSOCKNAME | |
76 | T}:T{ | |
77 | .BR getsockname (2) | |
78 | T} | |
79 | T{ | |
80 | .B SYS_GETPEERNAME | |
81 | T}:T{ | |
82 | .BR getpeername (2) | |
83 | T} | |
84 | T{ | |
85 | .B SYS_SOCKETPAIR | |
86 | T}:T{ | |
87 | .BR socketpair (2) | |
88 | T} | |
89 | T{ | |
90 | .B SYS_SEND | |
91 | T}:T{ | |
92 | .BR send (2) | |
93 | T} | |
94 | T{ | |
95 | .B SYS_RECV | |
96 | T}:T{ | |
97 | .BR recv (2) | |
98 | T} | |
99 | T{ | |
100 | .B SYS_SENDTO | |
101 | T}:T{ | |
102 | .BR sendto (2) | |
103 | T} | |
104 | T{ | |
105 | .B SYS_RECVFROM | |
106 | T}:T{ | |
107 | .BR recvfrom (2) | |
108 | T} | |
109 | T{ | |
110 | .B SYS_SHUTDOWN | |
111 | T}:T{ | |
112 | .BR shutdown (2) | |
113 | T} | |
114 | T{ | |
115 | .B SYS_SETSOCKOPT | |
116 | T}:T{ | |
117 | .BR setsockopt (2) | |
118 | T} | |
119 | T{ | |
120 | .B SYS_GETSOCKOPT | |
121 | T}:T{ | |
122 | .BR getsockopt (2) | |
123 | T} | |
124 | T{ | |
125 | .B SYS_SENDMSG | |
126 | T}:T{ | |
127 | .BR sendmsg (2) | |
128 | T} | |
129 | T{ | |
130 | .B SYS_RECVMSG | |
131 | T}:T{ | |
132 | .BR recvmsg (2) | |
133 | T} | |
134 | T{ | |
135 | .B SYS_ACCEPT4 | |
136 | T}:T{ | |
137 | .BR accept4 (2) | |
138 | T} | |
139 | T{ | |
140 | .B SYS_RECVMMSG | |
141 | T}:T{ | |
142 | .BR recvmmsg (2) | |
143 | T} | |
144 | T{ | |
145 | .B SYS_SENDMMSG | |
146 | T}:T{ | |
147 | .BR sendmmsg (2) | |
148 | T} | |
149 | .TE | |
47297adb | 150 | .SH CONFORMING TO |
fea681da MK |
151 | This call is specific to Linux, and should not be used in programs |
152 | intended to be portable. | |
bf25f45c | 153 | .SH NOTES |
cd1df3b8 | 154 | On a some architectures\(emfor example, x86-64 and ARM\(emthere is no |
bf25f45c MK |
155 | .BR socketcall () |
156 | system call; instead | |
157 | .BR socket (2), | |
158 | .BR accept (2), | |
159 | .BR bind (2), | |
160 | and so on really are implemented as separate system calls. | |
efeece04 | 161 | .PP |
b08d144c MK |
162 | On x86-32, |
163 | .BR socketcall () | |
164 | was historically the only entry point for the sockets API. | |
165 | However, starting in Linux 4.3, | |
166 | .\" commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb | |
167 | direct system calls are provided on x86-32 for the sockets API. | |
168 | This facilitates the creation of | |
169 | .BR seccomp (2) | |
170 | filters that filter sockets system calls | |
171 | (for new user-space binaries that are compiled | |
172 | to use the new entry points) | |
173 | and also provides a (very) small performance improvement. | |
47297adb | 174 | .SH SEE ALSO |
fea681da MK |
175 | .BR accept (2), |
176 | .BR bind (2), | |
177 | .BR connect (2), | |
178 | .BR getpeername (2), | |
179 | .BR getsockname (2), | |
180 | .BR getsockopt (2), | |
181 | .BR listen (2), | |
182 | .BR recv (2), | |
183 | .BR recvfrom (2), | |
ed2a6c73 | 184 | .BR recvmsg (2), |
fea681da | 185 | .BR send (2), |
ed2a6c73 | 186 | .BR sendmsg (2), |
f0c34053 | 187 | .BR sendto (2), |
fea681da MK |
188 | .BR setsockopt (2), |
189 | .BR shutdown (2), | |
190 | .BR socket (2), | |
191 | .BR socketpair (2) |