]>
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 | |
c7db92b9 | 29 | .nf |
f576fff5 | 30 | .B #include <linux/net.h> |
68e4db0a | 31 | .PP |
cc40d64d | 32 | .BI "int socketcall(int " call ", unsigned long *" args ); |
c7db92b9 | 33 | .fi |
fea681da | 34 | .SH DESCRIPTION |
e511ffb6 | 35 | .BR socketcall () |
fea681da MK |
36 | is a common kernel entry point for the socket system calls. |
37 | .I call | |
38 | determines which socket function to invoke. | |
39 | .I args | |
40 | points to a block containing the actual arguments, | |
41 | which are passed through to the appropriate call. | |
42 | .PP | |
43 | User programs should call the appropriate functions by their usual names. | |
44 | Only standard library implementors and kernel hackers need to know about | |
e511ffb6 | 45 | .BR socketcall (). |
f576fff5 MF |
46 | .PP |
47 | .TS | |
48 | tab(:); | |
49 | l l. | |
50 | \fIcall\fR:Man page | |
51 | T{ | |
52 | .B SYS_SOCKET | |
53 | T}:T{ | |
54 | .BR socket (2) | |
55 | T} | |
56 | T{ | |
57 | .B SYS_BIND | |
58 | T}:T{ | |
59 | .BR bind (2) | |
60 | T} | |
61 | T{ | |
62 | .B SYS_CONNECT | |
63 | T}:T{ | |
64 | .BR connect (2) | |
65 | T} | |
66 | T{ | |
67 | .B SYS_LISTEN | |
68 | T}:T{ | |
69 | .BR listen (2) | |
70 | T} | |
71 | T{ | |
72 | .B SYS_ACCEPT | |
73 | T}:T{ | |
74 | .BR accept (2) | |
75 | T} | |
76 | T{ | |
77 | .B SYS_GETSOCKNAME | |
78 | T}:T{ | |
79 | .BR getsockname (2) | |
80 | T} | |
81 | T{ | |
82 | .B SYS_GETPEERNAME | |
83 | T}:T{ | |
84 | .BR getpeername (2) | |
85 | T} | |
86 | T{ | |
87 | .B SYS_SOCKETPAIR | |
88 | T}:T{ | |
89 | .BR socketpair (2) | |
90 | T} | |
91 | T{ | |
92 | .B SYS_SEND | |
93 | T}:T{ | |
94 | .BR send (2) | |
95 | T} | |
96 | T{ | |
97 | .B SYS_RECV | |
98 | T}:T{ | |
99 | .BR recv (2) | |
100 | T} | |
101 | T{ | |
102 | .B SYS_SENDTO | |
103 | T}:T{ | |
104 | .BR sendto (2) | |
105 | T} | |
106 | T{ | |
107 | .B SYS_RECVFROM | |
108 | T}:T{ | |
109 | .BR recvfrom (2) | |
110 | T} | |
111 | T{ | |
112 | .B SYS_SHUTDOWN | |
113 | T}:T{ | |
114 | .BR shutdown (2) | |
115 | T} | |
116 | T{ | |
117 | .B SYS_SETSOCKOPT | |
118 | T}:T{ | |
119 | .BR setsockopt (2) | |
120 | T} | |
121 | T{ | |
122 | .B SYS_GETSOCKOPT | |
123 | T}:T{ | |
124 | .BR getsockopt (2) | |
125 | T} | |
126 | T{ | |
127 | .B SYS_SENDMSG | |
128 | T}:T{ | |
129 | .BR sendmsg (2) | |
130 | T} | |
131 | T{ | |
132 | .B SYS_RECVMSG | |
133 | T}:T{ | |
134 | .BR recvmsg (2) | |
135 | T} | |
136 | T{ | |
137 | .B SYS_ACCEPT4 | |
138 | T}:T{ | |
139 | .BR accept4 (2) | |
140 | T} | |
141 | T{ | |
142 | .B SYS_RECVMMSG | |
143 | T}:T{ | |
144 | .BR recvmmsg (2) | |
145 | T} | |
146 | T{ | |
147 | .B SYS_SENDMMSG | |
148 | T}:T{ | |
149 | .BR sendmmsg (2) | |
150 | T} | |
151 | .TE | |
47297adb | 152 | .SH CONFORMING TO |
fea681da MK |
153 | This call is specific to Linux, and should not be used in programs |
154 | intended to be portable. | |
bf25f45c | 155 | .SH NOTES |
cd1df3b8 | 156 | On a some architectures\(emfor example, x86-64 and ARM\(emthere is no |
bf25f45c MK |
157 | .BR socketcall () |
158 | system call; instead | |
159 | .BR socket (2), | |
160 | .BR accept (2), | |
161 | .BR bind (2), | |
162 | and so on really are implemented as separate system calls. | |
efeece04 | 163 | .PP |
b08d144c MK |
164 | On x86-32, |
165 | .BR socketcall () | |
166 | was historically the only entry point for the sockets API. | |
167 | However, starting in Linux 4.3, | |
168 | .\" commit 9dea5dc921b5f4045a18c63eb92e84dc274d17eb | |
169 | direct system calls are provided on x86-32 for the sockets API. | |
170 | This facilitates the creation of | |
171 | .BR seccomp (2) | |
172 | filters that filter sockets system calls | |
173 | (for new user-space binaries that are compiled | |
174 | to use the new entry points) | |
175 | and also provides a (very) small performance improvement. | |
47297adb | 176 | .SH SEE ALSO |
fea681da MK |
177 | .BR accept (2), |
178 | .BR bind (2), | |
179 | .BR connect (2), | |
180 | .BR getpeername (2), | |
181 | .BR getsockname (2), | |
182 | .BR getsockopt (2), | |
183 | .BR listen (2), | |
184 | .BR recv (2), | |
185 | .BR recvfrom (2), | |
ed2a6c73 | 186 | .BR recvmsg (2), |
fea681da | 187 | .BR send (2), |
ed2a6c73 | 188 | .BR sendmsg (2), |
f0c34053 | 189 | .BR sendto (2), |
fea681da MK |
190 | .BR setsockopt (2), |
191 | .BR shutdown (2), | |
192 | .BR socket (2), | |
193 | .BR socketpair (2) |