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