]>
Commit | Line | Data |
---|---|---|
15545eb6 HS |
1 | .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>, |
2 | .\" Copyright (C) 2008-2014, Michael Kerrisk <mtk.manpages@gmail.com>, | |
3 | .\" and Copyright (C) 2016, Heinrich Schuchardt <xypron.glpk@gmx.de> | |
2297bf0e | 4 | .\" |
00acdba1 | 5 | .\" %%%LICENSE_START(VERBATIM_ONE_PARA) |
77117f4f MK |
6 | .\" Permission is granted to distribute possibly modified copies |
7 | .\" of this page provided the header is included verbatim, | |
8 | .\" and in case of nontrivial modification author and date | |
9 | .\" of the modification is added to the header. | |
8ff7380d | 10 | .\" %%%LICENSE_END |
77117f4f MK |
11 | .\" |
12 | .\" Modified, 2003-12-02, Michael Kerrisk, <mtk.manpages@gmail.com> | |
13 | .\" Modified, 2003-09-23, Adam Langley | |
14 | .\" Modified, 2004-05-27, Michael Kerrisk, <mtk.manpages@gmail.com> | |
15 | .\" Added SOCK_SEQPACKET | |
16 | .\" 2008-05-27, mtk, Provide a clear description of the three types of | |
17 | .\" address that can appear in the sockaddr_un structure: pathname, | |
18 | .\" unnamed, and abstract. | |
19 | .\" | |
09b8afdc | 20 | .TH UNIX 7 2018-04-30 "Linux" "Linux Programmer's Manual" |
77117f4f | 21 | .SH NAME |
f68512e9 | 22 | unix \- sockets for local interprocess communication |
77117f4f MK |
23 | .SH SYNOPSIS |
24 | .B #include <sys/socket.h> | |
25 | .br | |
26 | .B #include <sys/un.h> | |
f90f031e | 27 | .PP |
d4c8c97c | 28 | .IB unix_socket " = socket(AF_UNIX, type, 0);" |
77117f4f | 29 | .br |
d4c8c97c | 30 | .IB error " = socketpair(AF_UNIX, type, 0, int *" sv ");" |
77117f4f MK |
31 | .SH DESCRIPTION |
32 | The | |
d4c8c97c | 33 | .B AF_UNIX |
77117f4f | 34 | (also known as |
d4c8c97c | 35 | .BR AF_LOCAL ) |
77117f4f MK |
36 | socket family is used to communicate between processes on the same machine |
37 | efficiently. | |
4891f52a | 38 | Traditionally, UNIX domain sockets can be either unnamed, |
9ee4a2b6 | 39 | or bound to a filesystem pathname (marked as being of type socket). |
77117f4f | 40 | Linux also supports an abstract namespace which is independent of the |
9ee4a2b6 | 41 | filesystem. |
5711c04f | 42 | .PP |
d02879f7 | 43 | Valid socket types in the UNIX domain are: |
77117f4f | 44 | .BR SOCK_STREAM , |
d02879f7 | 45 | for a stream-oriented socket; |
77117f4f MK |
46 | .BR SOCK_DGRAM , |
47 | for a datagram-oriented socket that preserves message boundaries | |
008f1ecc | 48 | (as on most UNIX implementations, UNIX domain datagram |
77117f4f MK |
49 | sockets are always reliable and don't reorder datagrams); |
50 | and (since Linux 2.6.4) | |
51 | .BR SOCK_SEQPACKET , | |
0d7e8d59 MK |
52 | for a sequenced-packet socket that is connection-oriented, |
53 | preserves message boundaries, | |
77117f4f | 54 | and delivers messages in the order that they were sent. |
5711c04f | 55 | .PP |
4891f52a | 56 | UNIX domain sockets support passing file descriptors or process credentials |
77117f4f | 57 | to other processes using ancillary data. |
c634028a | 58 | .SS Address format |
008f1ecc | 59 | A UNIX domain socket address is represented in the following structure: |
e646a1ba | 60 | .PP |
77117f4f | 61 | .in +4n |
e646a1ba | 62 | .EX |
63bc262c | 63 | .\" #define UNIX_PATH_MAX 108 |
5ffdc2fd | 64 | .\" |
77117f4f MK |
65 | struct sockaddr_un { |
66 | sa_family_t sun_family; /* AF_UNIX */ | |
b65f4c69 | 67 | char sun_path[108]; /* Pathname */ |
77117f4f | 68 | }; |
b8302363 | 69 | .EE |
77117f4f MK |
70 | .in |
71 | .PP | |
d02879f7 | 72 | The |
77117f4f | 73 | .I sun_family |
d02879f7 | 74 | field always contains |
77117f4f | 75 | .BR AF_UNIX . |
05bf3361 | 76 | On Linux, |
840aa3c7 MK |
77 | .I sun_path |
78 | is 108 bytes in size; see also NOTES, below. | |
5711c04f | 79 | .PP |
d02879f7 MK |
80 | Various systems calls (for example, |
81 | .BR bind (2), | |
82 | .BR connect (2), | |
83 | and | |
84 | .BR sendto (2)) | |
85 | take a | |
b8017cf5 | 86 | .I sockaddr_un |
d02879f7 MK |
87 | argument as input. |
88 | Some other system calls (for example, | |
89 | .BR getsockname (2), | |
90 | .BR getpeername (2), | |
91 | .BR recvfrom (2), | |
92 | and | |
93 | .BR accept (2)) | |
94 | return an argument of this type. | |
5711c04f | 95 | .PP |
d02879f7 MK |
96 | Three types of address are distinguished in the |
97 | .I sockaddr_un | |
98 | structure: | |
77117f4f MK |
99 | .IP * 3 |
100 | .IR pathname : | |
1c7b2458 MK |
101 | a UNIX domain socket can be bound to a null-terminated |
102 | filesystem pathname using | |
77117f4f | 103 | .BR bind (2). |
d02879f7 MK |
104 | When the address of a pathname socket is returned |
105 | (by one of the system calls noted above), | |
77117f4f | 106 | its length is |
5711c04f | 107 | .IP |
6cd06646 | 108 | offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1 |
5711c04f | 109 | .IP |
77117f4f MK |
110 | and |
111 | .I sun_path | |
112 | contains the null-terminated pathname. | |
d02879f7 MK |
113 | (On Linux, the above |
114 | .BR offsetof () | |
115 | expression equates to the same value as | |
116 | .IR sizeof(sa_family_t) , | |
117 | but some other implementations include other fields before | |
118 | .IR sun_path , | |
119 | so the | |
120 | .BR offsetof () | |
121 | expression more portably describes the size of the address structure.) | |
122 | .IP | |
123 | For further details of pathname sockets, see below. | |
77117f4f MK |
124 | .IP * |
125 | .IR unnamed : | |
126 | A stream socket that has not been bound to a pathname using | |
127 | .BR bind (2) | |
128 | has no name. | |
129 | Likewise, the two sockets created by | |
130 | .BR socketpair (2) | |
131 | are unnamed. | |
d02879f7 | 132 | When the address of an unnamed socket is returned, |
77117f4f MK |
133 | its length is |
134 | .IR "sizeof(sa_family_t)" , | |
135 | and | |
136 | .I sun_path | |
137 | should not be inspected. | |
138 | .\" There is quite some variation across implementations: FreeBSD | |
139 | .\" says the length is 16 bytes, HP-UX 11 says it's zero bytes. | |
140 | .IP * | |
141 | .IR abstract : | |
d02879f7 MK |
142 | an abstract socket address is distinguished (from a pathname socket) |
143 | by the fact that | |
77117f4f | 144 | .IR sun_path[0] |
836830b4 | 145 | is a null byte (\(aq\\0\(aq). |
156a0e0d MK |
146 | The socket's address in this namespace is given by the additional |
147 | bytes in | |
148 | .IR sun_path | |
149 | that are covered by the specified length of the address structure. | |
77117f4f | 150 | (Null bytes in the name have no special significance.) |
9ee4a2b6 | 151 | The name has no connection with filesystem pathnames. |
d02879f7 | 152 | When the address of an abstract socket is returned, |
156a0e0d MK |
153 | the returned |
154 | .I addrlen | |
155 | is greater than | |
156 | .IR "sizeof(sa_family_t)" | |
157 | (i.e., greater than 2), and the name of the socket is contained in | |
158 | the first | |
159 | .IR "(addrlen \- sizeof(sa_family_t))" | |
160 | bytes of | |
161 | .IR sun_path . | |
d02879f7 MK |
162 | .SS Pathname sockets |
163 | When binding a socket to a pathname, a few rules should be observed | |
164 | for maximum portability and ease of coding: | |
165 | .IP * 3 | |
166 | The pathname in | |
167 | .I sun_path | |
168 | should be null-terminated. | |
169 | .IP * | |
170 | The length of the pathname, including the terminating null byte, | |
171 | should not exceed the size of | |
172 | .IR sun_path . | |
173 | .IP * | |
174 | The | |
175 | .I addrlen | |
176 | argument that describes the enclosing | |
177 | .I sockaddr_un | |
178 | structure should have a value of at least: | |
5711c04f | 179 | .IP |
d02879f7 MK |
180 | .nf |
181 | offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1 | |
182 | .fi | |
183 | .IP | |
b8017cf5 | 184 | or, more simply, |
d02879f7 MK |
185 | .I addrlen |
186 | can be specified as | |
187 | .IR "sizeof(struct sockaddr_un)" . | |
188 | .PP | |
189 | There is some variation in how implementations handle UNIX domain | |
190 | socket addresses that do not follow the above rules. | |
191 | For example, some (but not all) implementations | |
192 | .\" Linux does this, including for the case where the supplied path | |
193 | .\" is 108 bytes | |
194 | append a null terminator if none is present in the supplied | |
195 | .IR sun_path . | |
5711c04f | 196 | .PP |
d02879f7 MK |
197 | When coding portable applications, |
198 | keep in mind that some implementations | |
199 | .\" HP-UX | |
200 | have | |
201 | .I sun_path | |
202 | as short as 92 bytes. | |
203 | .\" Modern BSDs generally have 104, Tru64 and AIX have 104, | |
204 | .\" Solaris and Irix have 108 | |
5711c04f | 205 | .PP |
d02879f7 MK |
206 | Various system calls |
207 | .RB ( accept (2), | |
208 | .BR recvfrom (2), | |
209 | .BR getsockname (2), | |
210 | .BR getpeername (2)) | |
211 | return socket address structures. | |
212 | When applied to UNIX domain sockets, the value-result | |
213 | .I addrlen | |
214 | argument supplied to the call should be initialized as above. | |
215 | Upon return, the argument is set to indicate the | |
216 | .I actual | |
217 | size of the address structure. | |
218 | The caller should check the value returned in this argument: | |
219 | if the output value exceeds the input value, | |
220 | then there is no guarantee that a null terminator is present in | |
221 | .IR sun_path . | |
222 | (See BUGS.) | |
9f213833 MK |
223 | .\" |
224 | .SS Pathname socket ownership and permissions | |
225 | In the Linux implementation, | |
226 | pathname sockets honor the permissions of the directory they are in. | |
a23d8efa | 227 | Creation of a new socket fails if the process does not have write and |
9f213833 | 228 | search (execute) permission on the directory in which the socket is created. |
5711c04f | 229 | .PP |
9f213833 MK |
230 | On Linux, |
231 | connecting to a stream socket object requires write permission on that socket; | |
232 | sending a datagram to a datagram socket likewise | |
233 | requires write permission on that socket. | |
234 | POSIX does not make any statement about the effect of the permissions | |
7f98a239 | 235 | on a socket file, and on some systems (e.g., older BSDs), |
9f213833 MK |
236 | the socket permissions are ignored. |
237 | Portable programs should not rely on | |
238 | this feature for security. | |
5711c04f | 239 | .PP |
9f213833 MK |
240 | When creating a new socket, the owner and group of the socket file |
241 | are set according to the usual rules. | |
242 | The socket file has all permissions enabled, | |
243 | other than those that are turned off by the process | |
244 | .BR umask (2). | |
5711c04f | 245 | .PP |
9f213833 MK |
246 | The owner, group, and permissions of a pathname socket can be changed (using |
247 | .BR chown (2) | |
248 | and | |
249 | .BR chmod (2)). | |
250 | .\" However, fchown() and fchmod() do not seem to have an effect | |
251 | .\" | |
d1875c13 | 252 | .SS Abstract sockets |
44cca454 MK |
253 | Socket permissions have no meaning for abstract sockets: |
254 | the process | |
255 | .BR umask (2) | |
256 | has no effect when binding an abstract socket, | |
257 | and changing the ownership and permissions of the object (via | |
258 | .BR fchown (2) | |
259 | and | |
260 | .BR fchmod (2)) | |
261 | has no effect on the accessibility of the socket. | |
5711c04f | 262 | .PP |
d1875c13 MK |
263 | Abstract sockets automatically disappear when all open references |
264 | to the socket are closed. | |
5711c04f | 265 | .PP |
d1875c13 MK |
266 | The abstract socket namespace is a nonportable Linux extension. |
267 | .\" | |
c634028a | 268 | .SS Socket options |
464b254b | 269 | For historical reasons, these socket options are specified with a |
77117f4f MK |
270 | .B SOL_SOCKET |
271 | type even though they are | |
d4c8c97c | 272 | .B AF_UNIX |
77117f4f MK |
273 | specific. |
274 | They can be set with | |
275 | .BR setsockopt (2) | |
276 | and read with | |
277 | .BR getsockopt (2) | |
278 | by specifying | |
279 | .B SOL_SOCKET | |
280 | as the socket family. | |
281 | .TP | |
282 | .B SO_PASSCRED | |
6074c3e6 | 283 | Enables the receiving of the credentials of the sending process in an |
77117f4f MK |
284 | ancillary message. |
285 | When this option is set and the socket is not yet connected | |
286 | a unique name in the abstract namespace will be generated automatically. | |
287 | Expects an integer boolean flag. | |
366a9bff MK |
288 | .TP |
289 | .B SO_PASSSEC | |
ffad6a01 MK |
290 | Enables receiving of the SELinux security label of the peer socket |
291 | in an ancillary message of type | |
292 | .BR SCM_SECURITY | |
293 | (see below). | |
366a9bff MK |
294 | Expects an integer boolean flag. |
295 | Supported for UNIX domain datagram sockets | |
296 | .\" commit 877ce7c1b3afd69a9b1caeb1b9964c992641f52a | |
297 | since Linux 2.6.18; | |
298 | support for UNIX domain stream sockets was added | |
299 | .\" commit 37a9a8df8ce9de6ea73349c9ac8bdf6ba4ec4f70 | |
300 | in Linux 4.2. | |
301 | .\" | |
c634028a | 302 | .SS Autobind feature |
0cf2caa4 | 303 | If a |
0b80cf56 | 304 | .BR bind (2) |
0cf2caa4 MK |
305 | call specifies |
306 | .I addrlen | |
307 | as | |
308 | .IR sizeof(sa_family_t) , | |
449dd4e2 | 309 | .\" i.e., sizeof(short) |
0cf2caa4 MK |
310 | or the |
311 | .BR SO_PASSCRED | |
312 | socket option was specified for a socket that was | |
313 | not explicitly bound to an address, | |
314 | then the socket is autobound to an abstract address. | |
315 | The address consists of a null byte | |
316 | followed by 5 bytes in the character set | |
9bc87ed0 | 317 | .IR [0\-9a\-f] . |
1e4e3bad MK |
318 | Thus, there is a limit of 2^20 autobind addresses. |
319 | (From Linux 2.1.15, when the autobind feature was added, | |
320 | 8 bytes were used, and the limit was thus 2^32 autobind addresses. | |
321 | The change to 5 bytes came in Linux 2.3.15.) | |
19e19f5f | 322 | .SS Sockets API |
77117f4f | 323 | The following paragraphs describe domain-specific details and |
008f1ecc | 324 | unsupported features of the sockets API for UNIX domain sockets on Linux. |
5711c04f | 325 | .PP |
008f1ecc | 326 | UNIX domain sockets do not support the transmission of |
77117f4f MK |
327 | out-of-band data (the |
328 | .B MSG_OOB | |
329 | flag for | |
330 | .BR send (2) | |
331 | and | |
332 | .BR recv (2)). | |
5711c04f | 333 | .PP |
77117f4f MK |
334 | The |
335 | .BR send (2) | |
336 | .B MSG_MORE | |
008f1ecc | 337 | flag is not supported by UNIX domain sockets. |
5711c04f | 338 | .PP |
c9a39fea MK |
339 | Before Linux 3.4, |
340 | .\" commit 9f6f9af7694ede6314bed281eec74d588ba9474f | |
341 | the use of | |
77e75b90 MK |
342 | .B MSG_TRUNC |
343 | in the | |
344 | .I flags | |
345 | argument of | |
346 | .BR recv (2) | |
c9a39fea | 347 | was not supported by UNIX domain sockets. |
5711c04f | 348 | .PP |
77117f4f MK |
349 | The |
350 | .B SO_SNDBUF | |
008f1ecc | 351 | socket option does have an effect for UNIX domain sockets, but the |
77117f4f MK |
352 | .B SO_RCVBUF |
353 | option does not. | |
354 | For datagram sockets, the | |
355 | .B SO_SNDBUF | |
356 | value imposes an upper limit on the size of outgoing datagrams. | |
357 | This limit is calculated as the doubled (see | |
358 | .BR socket (7)) | |
359 | option value less 32 bytes used for overhead. | |
c634028a | 360 | .SS Ancillary messages |
77117f4f MK |
361 | Ancillary data is sent and received using |
362 | .BR sendmsg (2) | |
363 | and | |
364 | .BR recvmsg (2). | |
05bf3361 | 365 | For historical reasons, the ancillary message types listed below |
77117f4f MK |
366 | are specified with a |
367 | .B SOL_SOCKET | |
368 | type even though they are | |
d4c8c97c | 369 | .B AF_UNIX |
77117f4f | 370 | specific. |
05bf3361 | 371 | To send them, set the |
77117f4f MK |
372 | .I cmsg_level |
373 | field of the struct | |
374 | .I cmsghdr | |
375 | to | |
376 | .B SOL_SOCKET | |
377 | and the | |
378 | .I cmsg_type | |
379 | field to the type. | |
05bf3361 | 380 | For more information, see |
77117f4f MK |
381 | .BR cmsg (3). |
382 | .TP | |
383 | .B SCM_RIGHTS | |
384 | Send or receive a set of open file descriptors from another process. | |
385 | The data portion contains an integer array of the file descriptors. | |
87996200 | 386 | .IP |
13600496 MK |
387 | Commonly, this operation is referred to as "passing a file descriptor" |
388 | to another process. | |
389 | However, more accurately, | |
390 | what is being passed is a reference to an open file description (see | |
391 | .BR open (2)), | |
392 | and in the receiving process it is likely that a different | |
393 | file descriptor number will be used. | |
394 | Semantically, this operation is equivalent to duplicating | |
395 | .RB ( dup (2)) | |
396 | a file descriptor into the file descriptor table of another process. | |
8bdcf4bf | 397 | .IP |
4564dd1f MK |
398 | If the buffer used to receive the ancillary data containing |
399 | file descriptors is too small (or is absent), | |
400 | then the ancillary data is truncated (or discarded) | |
401 | and the excess file descriptors are automatically closed | |
402 | in the receiving process. | |
403 | .IP | |
8bdcf4bf MK |
404 | The kernel constant |
405 | .BR SCM_MAX_FD | |
406 | defines a limit on the number of file descriptors in the array. | |
1221abb6 | 407 | Attempting to send an array larger than this limit causes |
8bdcf4bf MK |
408 | .BR sendmsg (2) |
409 | to fail with the error | |
410 | .BR EINVAL . | |
411 | .BR SCM_MAX_FD | |
412 | has the value 253 | |
413 | (or 255 in kernels | |
414 | .\" commit bba14de98753cb6599a2dae0e520714b2153522d | |
415 | before 2.6.38). | |
77117f4f MK |
416 | .TP |
417 | .B SCM_CREDENTIALS | |
008f1ecc | 418 | Send or receive UNIX credentials. |
77117f4f MK |
419 | This can be used for authentication. |
420 | The credentials are passed as a | |
421 | .I struct ucred | |
422 | ancillary message. | |
b1587ca8 MK |
423 | Thus structure is defined in |
424 | .I <sys/socket.h> | |
425 | as follows: | |
5711c04f | 426 | .IP |
77117f4f | 427 | .in +4n |
b8302363 | 428 | .EX |
77117f4f | 429 | struct ucred { |
b65f4c69 MK |
430 | pid_t pid; /* Process ID of the sending process */ |
431 | uid_t uid; /* User ID of the sending process */ | |
432 | gid_t gid; /* Group ID of the sending process */ | |
77117f4f | 433 | }; |
b8302363 | 434 | .EE |
77117f4f | 435 | .in |
5711c04f | 436 | .IP |
b1587ca8 | 437 | Since glibc 2.8, the |
1bc510f5 | 438 | .B _GNU_SOURCE |
e417acb0 MK |
439 | feature test macro must be defined (before including |
440 | .I any | |
441 | header files) in order to obtain the definition | |
b1587ca8 | 442 | of this structure. |
5711c04f | 443 | .IP |
77117f4f | 444 | The credentials which the sender specifies are checked by the kernel. |
f1081bdc | 445 | A privileged process is allowed to specify values that do not match its own. |
77117f4f MK |
446 | The sender must specify its own process ID (unless it has the capability |
447 | .BR CAP_SYS_ADMIN ), | |
06b8a13b | 448 | its real user ID, effective user ID, or saved set-user-ID (unless it has |
77117f4f | 449 | .BR CAP_SETUID ), |
06b8a13b | 450 | and its real group ID, effective group ID, or saved set-group-ID |
77117f4f MK |
451 | (unless it has |
452 | .BR CAP_SETGID ). | |
bdef8021 | 453 | .IP |
77117f4f MK |
454 | To receive a |
455 | .I struct ucred | |
b66d5714 | 456 | message, the |
77117f4f MK |
457 | .B SO_PASSCRED |
458 | option must be enabled on the socket. | |
ffad6a01 MK |
459 | .TP |
460 | .B SCM_SECURITY | |
461 | Receive the SELinux security context (the security label) | |
462 | of the peer socket. | |
463 | The received ancillary data is a null-terminated string containing | |
464 | the security context. | |
465 | The receiver should allocate at least | |
466 | .BR NAME_MAX | |
467 | bytes in the data portion of the ancillary message for this data. | |
468 | .IP | |
469 | To receive the security context, the | |
470 | .B SO_PASSSEC | |
471 | option must be enabled on the socket (see above). | |
c8772146 | 472 | .PP |
5b5cb195 MK |
473 | When sending ancillary data with |
474 | .BR sendmsg (2), | |
475 | only one item of each of the above types may be included in the sent message. | |
476 | .PP | |
5219daec MK |
477 | At least one byte of real data should be sent when sending ancillary data. |
478 | On Linux, this is required to successfully send ancillary data over | |
479 | a UNIX domain stream socket. | |
480 | When sending ancillary data over a UNIX domain datagram socket, | |
481 | it is not necessary on Linux to send any accompanying real data. | |
482 | However, portable applications should also include at least one byte | |
483 | of real data when sending ancillary data over a datagram socket. | |
484 | .PP | |
5af0f223 MK |
485 | When receiving from a stream socket, |
486 | ancillary data forms a kind of barrier for the received data. | |
487 | For example, suppose that the sender transmits as follows: | |
488 | .PP | |
489 | .RS | |
490 | .PD 0 | |
491 | .IP 1. 3 | |
492 | .BR sendmsg (2) | |
493 | of four bytes, with no ancillary data. | |
494 | .IP 2. | |
495 | .BR sendmsg (2) | |
496 | of one byte, with ancillary data. | |
497 | .IP 3. | |
498 | .BR sendmsg (2) | |
499 | of four bytes, with no ancillary data. | |
500 | .PD | |
501 | .RE | |
502 | .PP | |
503 | Suppose that the receiver now performs | |
504 | .BR recvmsg (2) | |
505 | calls each with a buffer size of 20 bytes. | |
506 | The first call will receive five bytes of data, | |
507 | along with the ancillary data sent by the second | |
508 | .BR sendmsg (2) | |
509 | call. | |
510 | The next call will receive the remaining five bytes of data. | |
511 | .PP | |
c0e56ed6 | 512 | If the space allocated for receiving incoming ancillary data is too small |
c8772146 MK |
513 | then the ancillary data is truncated to the number of headers |
514 | that will fit in the supplied buffer (or, in the case of an | |
515 | .BR SCM_RIGHTS | |
516 | file descriptor list, the list of file descriptors may be truncated). | |
c0e56ed6 MK |
517 | If no buffer is provided for incoming ancillary data (i.e., the |
518 | .I msg_control | |
519 | field of the | |
520 | .I msghdr | |
521 | structure supplied to | |
522 | .BR recvmsg (2) | |
523 | is NULL), | |
524 | then the incoming ancillary data is discarded. | |
525 | In both of these cases, the | |
c8772146 MK |
526 | .BR MSG_CTRUNC |
527 | flag will be set in the | |
528 | .I msg.msg_flags | |
529 | value returned by | |
530 | .BR recvmsg (2). | |
531 | .\" | |
fbea0f81 MK |
532 | .SS Ioctls |
533 | The following | |
534 | .BR ioctl (2) | |
535 | calls return information in | |
536 | .IR value . | |
537 | The correct syntax is: | |
538 | .PP | |
539 | .RS | |
540 | .nf | |
541 | .BI int " value"; | |
f0d77d97 | 542 | .IB error " = ioctl(" unix_socket ", " ioctl_type ", &" value ");" |
fbea0f81 MK |
543 | .fi |
544 | .RE | |
545 | .PP | |
546 | .I ioctl_type | |
547 | can be: | |
548 | .TP | |
549 | .B SIOCINQ | |
170e5f0d JC |
550 | For |
551 | .B SOCK_STREAM | |
311bf2f6 | 552 | sockets, this call returns the number of unread bytes in the receive buffer. |
fbea0f81 MK |
553 | The socket must not be in LISTEN state, otherwise an error |
554 | .RB ( EINVAL ) | |
555 | is returned. | |
556 | .B SIOCINQ | |
557 | is defined in | |
558 | .IR <linux/sockios.h> . | |
bea08fec | 559 | .\" FIXME . http://sources.redhat.com/bugzilla/show_bug.cgi?id=12002, |
fbea0f81 MK |
560 | .\" filed 2010-09-10, may cause SIOCINQ to be defined in glibc headers |
561 | Alternatively, | |
562 | you can use the synonymous | |
563 | .BR FIONREAD , | |
564 | defined in | |
565 | .IR <sys/ioctl.h> . | |
7aed61d9 | 566 | .\" SIOCOUTQ also has an effect for UNIX domain sockets, but not |
fbea0f81 MK |
567 | .\" quite what userland might expect. It seems to return the number |
568 | .\" of bytes allocated for buffers containing pending output. | |
569 | .\" That number is normally larger than the number of bytes of pending | |
570 | .\" output. Since this info is, from userland's point of view, imprecise, | |
571 | .\" and it may well change, probably best not to document this now. | |
170e5f0d JC |
572 | For |
573 | .B SOCK_DGRAM | |
311bf2f6 | 574 | sockets, |
170e5f0d | 575 | the returned value is the same as |
311bf2f6 | 576 | for Internet domain datagram sockets; |
170e5f0d JC |
577 | see |
578 | .BR udp (7). | |
77117f4f MK |
579 | .SH ERRORS |
580 | .TP | |
581 | .B EADDRINUSE | |
9ee4a2b6 | 582 | The specified local address is already in use or the filesystem socket |
77117f4f MK |
583 | object already exists. |
584 | .TP | |
7934bcdf MK |
585 | .B EBADF |
586 | This error can occur for | |
587 | .BR sendmsg (2) | |
588 | when sending a file descriptor as ancillary data over | |
589 | a UNIX domain socket (see the description of | |
590 | .BR SCM_RIGHTS , | |
591 | above), and indicates that the file descriptor number that | |
3eb078c5 | 592 | is being sent is not valid (e.g., it is not an open file descriptor). |
7934bcdf | 593 | .TP |
77117f4f | 594 | .B ECONNREFUSED |
1fe284ab | 595 | The remote address specified by |
77117f4f | 596 | .BR connect (2) |
1fe284ab | 597 | was not a listening socket. |
d02879f7 | 598 | This error can also occur if the target pathname is not a socket. |
77117f4f MK |
599 | .TP |
600 | .B ECONNRESET | |
601 | Remote socket was unexpectedly closed. | |
602 | .TP | |
603 | .B EFAULT | |
604 | User memory address was not valid. | |
605 | .TP | |
606 | .B EINVAL | |
607 | Invalid argument passed. | |
1fe284ab | 608 | A common cause is that the value |
40656bc7 | 609 | .B AF_UNIX |
1fe284ab | 610 | was not specified in the |
77117f4f | 611 | .I sun_type |
1fe284ab | 612 | field of passed addresses, or the socket was in an |
77117f4f MK |
613 | invalid state for the applied operation. |
614 | .TP | |
615 | .B EISCONN | |
616 | .BR connect (2) | |
617 | called on an already connected socket or a target address was | |
618 | specified on a connected socket. | |
619 | .TP | |
ec55a2b6 MK |
620 | .B ENOENT |
621 | The pathname in the remote address specified to | |
9470f355 | 622 | .BR connect (2) |
ec55a2b6 MK |
623 | did not exist. |
624 | .TP | |
77117f4f MK |
625 | .B ENOMEM |
626 | Out of memory. | |
627 | .TP | |
628 | .B ENOTCONN | |
629 | Socket operation needs a target address, but the socket is not connected. | |
630 | .TP | |
631 | .B EOPNOTSUPP | |
632 | Stream operation called on non-stream oriented socket or tried to | |
633 | use the out-of-band data option. | |
634 | .TP | |
635 | .B EPERM | |
636 | The sender passed invalid credentials in the | |
637 | .IR "struct ucred" . | |
638 | .TP | |
639 | .B EPIPE | |
640 | Remote socket was closed on a stream socket. | |
641 | If enabled, a | |
642 | .B SIGPIPE | |
643 | is sent as well. | |
644 | This can be avoided by passing the | |
645 | .B MSG_NOSIGNAL | |
646 | flag to | |
110039c1 | 647 | .BR send (2) |
77117f4f | 648 | or |
110039c1 | 649 | .BR sendmsg (2). |
77117f4f MK |
650 | .TP |
651 | .B EPROTONOSUPPORT | |
cd0221ea MK |
652 | Passed protocol is not |
653 | .BR AF_UNIX . | |
77117f4f MK |
654 | .TP |
655 | .B EPROTOTYPE | |
656 | Remote socket does not match the local socket type | |
657 | .RB ( SOCK_DGRAM | |
d1c9ea80 | 658 | versus |
9ca2e0c1 | 659 | .BR SOCK_STREAM ). |
77117f4f MK |
660 | .TP |
661 | .B ESOCKTNOSUPPORT | |
662 | Unknown socket type. | |
dc4eea68 MK |
663 | .TP |
664 | .B ETOOMANYREFS | |
665 | This error can occur for | |
666 | .BR sendmsg (2) | |
4529d4e5 | 667 | when sending a file descriptor as ancillary data over |
dc4eea68 MK |
668 | a UNIX domain socket (see the description of |
669 | .BR SCM_RIGHTS , | |
670 | above). | |
671 | It occurs if the number of "in-flight" file descriptors exceeds the | |
672 | .B RLIMIT_NOFILE | |
673 | resource limit and the caller does not have the | |
674 | .BR CAP_SYS_RESOURCE | |
675 | capability. | |
676 | An in-flight file descriptor is one that has been sent using | |
677 | .BR sendmsg (2) | |
678 | but has not yet been accepted in the recipient process using | |
679 | .BR recvmsg (2). | |
5711c04f | 680 | .IP |
70fdcbc2 MK |
681 | This error is diagnosed since mainline Linux 4.5 |
682 | (and in some earlier kernel versions where the fix has been backported). | |
dc4eea68 MK |
683 | .\" commit 712f4aad406bb1ed67f3f98d04c044191f0ff593 |
684 | In earlier kernel versions, | |
685 | it was possible to place an unlimited number of file descriptors in flight, | |
686 | by sending each file descriptor with | |
687 | .BR sendmsg (2) | |
688 | and then closing the file descriptor so that it was not accounted against the | |
689 | .B RLIMIT_NOFILE | |
690 | resource limit. | |
77117f4f MK |
691 | .PP |
692 | Other errors can be generated by the generic socket layer or | |
9ee4a2b6 | 693 | by the filesystem while generating a filesystem socket object. |
77117f4f MK |
694 | See the appropriate manual pages for more information. |
695 | .SH VERSIONS | |
696 | .B SCM_CREDENTIALS | |
697 | and the abstract namespace were introduced with Linux 2.2 and should not | |
698 | be used in portable programs. | |
699 | (Some BSD-derived systems also support credential passing, | |
700 | but the implementation details differ.) | |
701 | .SH NOTES | |
00b78c5f MK |
702 | Binding to a socket with a filename creates a socket |
703 | in the filesystem that must be deleted by the caller when it is no | |
704 | longer needed (using | |
705 | .BR unlink (2)). | |
706 | The usual UNIX close-behind semantics apply; the socket can be unlinked | |
707 | at any time and will be finally removed from the filesystem when the last | |
708 | reference to it is closed. | |
5711c04f | 709 | .PP |
00b78c5f | 710 | To pass file descriptors or credentials over a |
d3e7786d MK |
711 | .BR SOCK_STREAM |
712 | socket, you must | |
00b78c5f MK |
713 | to send or receive at least one byte of nonancillary data in the same |
714 | .BR sendmsg (2) | |
715 | or | |
716 | .BR recvmsg (2) | |
717 | call. | |
5711c04f | 718 | .PP |
00b78c5f MK |
719 | UNIX domain stream sockets do not support the notion of out-of-band data. |
720 | .\" | |
d02879f7 MK |
721 | .SH BUGS |
722 | When binding a socket to an address, | |
723 | Linux is one of the implementations that appends a null terminator | |
724 | if none is supplied in | |
725 | .IR sun_path . | |
726 | In most cases this is unproblematic: | |
727 | when the socket address is retrieved, | |
728 | it will be one byte longer than that supplied when the socket was bound. | |
729 | However, there is one case where confusing behavior can result: | |
730 | if 108 non-null bytes are supplied when a socket is bound, | |
731 | then the addition of the null terminator takes the length of | |
732 | the pathname beyond | |
733 | .IR sizeof(sun_path) . | |
734 | Consequently, when retrieving the socket address | |
735 | (for example, via | |
736 | .BR accept (2)), | |
737 | .\" The behavior on Solaris is quite similar. | |
738 | if the input | |
739 | .I addrlen | |
740 | argument for the retrieving call is specified as | |
741 | .IR "sizeof(struct sockaddr_un)" , | |
742 | then the returned address structure | |
743 | .I won't | |
744 | have a null terminator in | |
745 | .IR sun_path . | |
5711c04f | 746 | .PP |
d02879f7 MK |
747 | In addition, some implementations |
748 | .\" i.e., traditional BSD | |
749 | don't require a null terminator when binding a socket (the | |
750 | .I addrlen | |
751 | argument is used to determine the length of | |
752 | .IR sun_path ) | |
753 | and when the socket address is retrieved on these implementations, | |
754 | there is no null terminator in | |
755 | .IR sun_path . | |
5711c04f | 756 | .PP |
b8017cf5 | 757 | Applications that retrieve socket addresses can (portably) code |
d02879f7 MK |
758 | to handle the possibility that there is no null terminator in |
759 | .IR sun_path | |
760 | by respecting the fact that the number of valid bytes in the pathname is: | |
5711c04f | 761 | .PP |
d02879f7 MK |
762 | strnlen(addr.sun_path, addrlen \- offsetof(sockaddr_un, sun_path)) |
763 | .\" The following patch to amend kernel behavior was rejected: | |
764 | .\" http://thread.gmane.org/gmane.linux.kernel.api/2437 | |
765 | .\" Subject: [patch] Fix handling of overlength pathname in AF_UNIX sun_path | |
766 | .\" 2012-04-17 | |
767 | .\" And there was a related discussion in the Austin list: | |
768 | .\" http://thread.gmane.org/gmane.comp.standards.posix.austin.general/5735 | |
769 | .\" Subject: Having a sun_path with no null terminator | |
770 | .\" 2012-04-18 | |
771 | .\" | |
772 | .\" FIXME . Track http://austingroupbugs.net/view.php?id=561 | |
5711c04f | 773 | .PP |
d02879f7 MK |
774 | Alternatively, an application can retrieve |
775 | the socket address by allocating a buffer of size | |
776 | .I "sizeof(struct sockaddr_un)+1" | |
777 | that is zeroed out before the retrieval. | |
778 | The retrieving call can specify | |
779 | .I addrlen | |
780 | as | |
781 | .IR "sizeof(struct sockaddr_un)" , | |
782 | and the extra zero byte ensures that there will be | |
783 | a null terminator for the string returned in | |
784 | .IR sun_path : | |
5711c04f | 785 | .PP |
a2b7a144 MK |
786 | .in +4n |
787 | .EX | |
d02879f7 MK |
788 | void *addrp; |
789 | ||
790 | addrlen = sizeof(struct sockaddr_un); | |
791 | addrp = malloc(addrlen + 1); | |
792 | if (addrp == NULL) | |
793 | /* Handle error */ ; | |
794 | memset(addrp, 0, addrlen + 1); | |
795 | ||
3e35b19b | 796 | if (getsockname(sfd, (struct sockaddr *) addrp, &addrlen)) == \-1) |
d02879f7 MK |
797 | /* handle error */ ; |
798 | ||
799 | printf("sun_path = %s\\n", ((struct sockaddr_un *) addrp)\->sun_path); | |
b8302363 | 800 | .EE |
e646a1ba | 801 | .in |
5711c04f | 802 | .PP |
d02879f7 MK |
803 | This sort of messiness can be avoided if it is guaranteed |
804 | that the applications that | |
805 | .I create | |
806 | pathname sockets follow the rules outlined above under | |
807 | .IR "Pathname sockets" . | |
77117f4f | 808 | .SH EXAMPLE |
84c8cae2 MK |
809 | The following code demonstrates the use of sequenced-packet |
810 | sockets for local interprocess communication. | |
eb73e8ad | 811 | It consists of two programs. |
15545eb6 | 812 | The server program waits for a connection from the client program. |
84c8cae2 MK |
813 | The client sends each of its command-line arguments in separate messages. |
814 | The server treats the incoming messages as integers and adds them up. | |
eb73e8ad | 815 | The client sends the command string "END". |
84c8cae2 MK |
816 | The server sends back a message containing the sum of the client's integers. |
817 | The client prints the sum and exits. | |
15545eb6 | 818 | The server waits for the next client to connect. |
84c8cae2 | 819 | To stop the server, the client is called with the command-line argument "DOWN". |
15545eb6 HS |
820 | .PP |
821 | The following output was recorded while running the server in the background | |
84c8cae2 MK |
822 | and repeatedly executing the client. |
823 | Execution of the server program ends when it receives the "DOWN" command. | |
15545eb6 HS |
824 | .SS Example output |
825 | .in +4n | |
b8302363 | 826 | .EX |
eb73e8ad | 827 | $ \fB./server &\fP |
15545eb6 | 828 | [1] 25887 |
eb73e8ad | 829 | $ \fB./client 3 4\fP |
15545eb6 | 830 | Result = 7 |
eb73e8ad | 831 | $ \fB./client 11 \-5\fP |
15545eb6 | 832 | Result = 6 |
eb73e8ad | 833 | $ \fB./client DOWN\fP |
15545eb6 HS |
834 | Result = 0 |
835 | [1]+ Done ./server | |
836 | $ | |
b8302363 | 837 | .EE |
15545eb6 HS |
838 | .in |
839 | .SS Program source | |
c7885256 | 840 | \& |
e7d0bb47 | 841 | .EX |
15545eb6 HS |
842 | /* |
843 | * File connection.h | |
844 | */ | |
845 | ||
846 | #define SOCKET_NAME "/tmp/9Lq7BNBnBycd6nxy.socket" | |
847 | #define BUFFER_SIZE 12 | |
848 | ||
849 | /* | |
850 | * File server.c | |
851 | */ | |
852 | ||
853 | #include <stdio.h> | |
854 | #include <stdlib.h> | |
855 | #include <string.h> | |
856 | #include <sys/socket.h> | |
857 | #include <sys/un.h> | |
858 | #include <unistd.h> | |
859 | #include "connection.h" | |
860 | ||
861 | int | |
862 | main(int argc, char *argv[]) | |
863 | { | |
864 | struct sockaddr_un name; | |
865 | int down_flag = 0; | |
866 | int ret; | |
867 | int connection_socket; | |
868 | int data_socket; | |
869 | int result; | |
870 | char buffer[BUFFER_SIZE]; | |
871 | ||
872 | /* | |
eb73e8ad | 873 | * In case the program exited inadvertently on the last run, |
15545eb6 HS |
874 | * remove the socket. |
875 | */ | |
876 | ||
877 | unlink(SOCKET_NAME); | |
878 | ||
879 | /* Create local socket. */ | |
880 | ||
881 | connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0); | |
882 | if (connection_socket == \-1) { | |
883 | perror("socket"); | |
884 | exit(EXIT_FAILURE); | |
885 | } | |
886 | ||
887 | /* | |
eb73e8ad MK |
888 | * For portability clear the whole structure, since some |
889 | * implementations have additional (nonstandard) fields in | |
890 | * the structure. | |
15545eb6 HS |
891 | */ |
892 | ||
893 | memset(&name, 0, sizeof(struct sockaddr_un)); | |
894 | ||
895 | /* Bind socket to socket name. */ | |
896 | ||
897 | name.sun_family = AF_UNIX; | |
898 | strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) \- 1); | |
899 | ||
900 | ret = bind(connection_socket, (const struct sockaddr *) &name, | |
901 | sizeof(struct sockaddr_un)); | |
902 | if (ret == \-1) { | |
903 | perror("bind"); | |
904 | exit(EXIT_FAILURE); | |
905 | } | |
906 | ||
907 | /* | |
eb73e8ad MK |
908 | * Prepare for accepting connections. The backlog size is set |
909 | * to 20. So while one request is being processed other requests | |
910 | * can be waiting. | |
15545eb6 HS |
911 | */ |
912 | ||
913 | ret = listen(connection_socket, 20); | |
914 | if (ret == \-1) { | |
915 | perror("listen"); | |
916 | exit(EXIT_FAILURE); | |
917 | } | |
918 | ||
919 | /* This is the main loop for handling connections. */ | |
920 | ||
921 | for (;;) { | |
922 | ||
15545eb6 HS |
923 | /* Wait for incoming connection. */ |
924 | ||
925 | data_socket = accept(connection_socket, NULL, NULL); | |
3cb43b95 | 926 | if (data_socket == \-1) { |
15545eb6 HS |
927 | perror("accept"); |
928 | exit(EXIT_FAILURE); | |
929 | } | |
930 | ||
931 | result = 0; | |
52900faa | 932 | for (;;) { |
15545eb6 HS |
933 | |
934 | /* Wait for next data packet. */ | |
935 | ||
936 | ret = read(data_socket, buffer, BUFFER_SIZE); | |
937 | if (ret == \-1) { | |
eb73e8ad | 938 | perror("read"); |
15545eb6 HS |
939 | exit(EXIT_FAILURE); |
940 | } | |
941 | ||
942 | /* Ensure buffer is 0\-terminated. */ | |
943 | ||
944 | buffer[BUFFER_SIZE \- 1] = 0; | |
945 | ||
946 | /* Handle commands. */ | |
947 | ||
948 | if (!strncmp(buffer, "DOWN", BUFFER_SIZE)) { | |
949 | down_flag = 1; | |
950 | break; | |
951 | } | |
952 | ||
953 | if (!strncmp(buffer, "END", BUFFER_SIZE)) { | |
954 | break; | |
955 | } | |
956 | ||
957 | /* Add received summand. */ | |
958 | ||
959 | result += atoi(buffer); | |
960 | } | |
c751683c | 961 | |
15545eb6 HS |
962 | /* Send result. */ |
963 | ||
964 | sprintf(buffer, "%d", result); | |
965 | ret = write(data_socket, buffer, BUFFER_SIZE); | |
15545eb6 | 966 | if (ret == \-1) { |
eb73e8ad | 967 | perror("write"); |
15545eb6 HS |
968 | exit(EXIT_FAILURE); |
969 | } | |
970 | ||
971 | /* Close socket. */ | |
972 | ||
973 | close(data_socket); | |
974 | ||
975 | /* Quit on DOWN command. */ | |
976 | ||
977 | if (down_flag) { | |
978 | break; | |
979 | } | |
980 | } | |
981 | ||
982 | close(connection_socket); | |
983 | ||
984 | /* Unlink the socket. */ | |
985 | ||
986 | unlink(SOCKET_NAME); | |
987 | ||
988 | exit(EXIT_SUCCESS); | |
989 | } | |
990 | ||
991 | /* | |
992 | * File client.c | |
993 | */ | |
994 | ||
995 | #include <errno.h> | |
996 | #include <stdio.h> | |
997 | #include <stdlib.h> | |
998 | #include <string.h> | |
999 | #include <sys/socket.h> | |
1000 | #include <sys/un.h> | |
1001 | #include <unistd.h> | |
1002 | #include "connection.h" | |
1003 | ||
1004 | int | |
1005 | main(int argc, char *argv[]) | |
1006 | { | |
24a31d63 | 1007 | struct sockaddr_un addr; |
15545eb6 HS |
1008 | int i; |
1009 | int ret; | |
1010 | int data_socket; | |
1011 | char buffer[BUFFER_SIZE]; | |
1012 | ||
1013 | /* Create local socket. */ | |
1014 | ||
1015 | data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0); | |
1016 | if (data_socket == \-1) { | |
1017 | perror("socket"); | |
1018 | exit(EXIT_FAILURE); | |
1019 | } | |
1020 | ||
1021 | /* | |
eb73e8ad MK |
1022 | * For portability clear the whole structure, since some |
1023 | * implementations have additional (nonstandard) fields in | |
1024 | * the structure. | |
15545eb6 HS |
1025 | */ |
1026 | ||
24a31d63 | 1027 | memset(&addr, 0, sizeof(struct sockaddr_un)); |
15545eb6 | 1028 | |
24a31d63 | 1029 | /* Connect socket to socket address */ |
15545eb6 | 1030 | |
24a31d63 MK |
1031 | addr.sun_family = AF_UNIX; |
1032 | strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) \- 1); | |
15545eb6 | 1033 | |
24a31d63 | 1034 | ret = connect (data_socket, (const struct sockaddr *) &addr, |
15545eb6 HS |
1035 | sizeof(struct sockaddr_un)); |
1036 | if (ret == \-1) { | |
1037 | fprintf(stderr, "The server is down.\\n"); | |
1038 | exit(EXIT_FAILURE); | |
1039 | } | |
1040 | ||
1041 | /* Send arguments. */ | |
1042 | ||
1043 | for (i = 1; i < argc; ++i) { | |
1044 | ret = write(data_socket, argv[i], strlen(argv[i]) + 1); | |
1045 | if (ret == \-1) { | |
eb73e8ad | 1046 | perror("write"); |
15545eb6 HS |
1047 | break; |
1048 | } | |
1049 | } | |
1050 | ||
1051 | /* Request result. */ | |
1052 | ||
1053 | strcpy (buffer, "END"); | |
1054 | ret = write(data_socket, buffer, strlen(buffer) + 1); | |
1055 | if (ret == \-1) { | |
eb73e8ad | 1056 | perror("write"); |
15545eb6 HS |
1057 | exit(EXIT_FAILURE); |
1058 | } | |
1059 | ||
15545eb6 HS |
1060 | /* Receive result. */ |
1061 | ||
1062 | ret = read(data_socket, buffer, BUFFER_SIZE); | |
1063 | if (ret == \-1) { | |
eb73e8ad | 1064 | perror("read"); |
15545eb6 HS |
1065 | exit(EXIT_FAILURE); |
1066 | } | |
1067 | ||
1068 | /* Ensure buffer is 0\-terminated. */ | |
1069 | ||
1070 | buffer[BUFFER_SIZE \- 1] = 0; | |
1071 | ||
1072 | printf("Result = %s\\n", buffer); | |
1073 | ||
1074 | /* Close socket. */ | |
1075 | ||
1076 | close(data_socket); | |
1077 | ||
1078 | exit(EXIT_SUCCESS); | |
1079 | } | |
e7d0bb47 | 1080 | .EE |
15545eb6 | 1081 | .PP |
c751683c MK |
1082 | For an example of the use of |
1083 | .BR SCM_RIGHTS | |
1084 | see | |
1085 | .BR cmsg (3). | |
47297adb | 1086 | .SH SEE ALSO |
77117f4f MK |
1087 | .BR recvmsg (2), |
1088 | .BR sendmsg (2), | |
1089 | .BR socket (2), | |
1090 | .BR socketpair (2), | |
1091 | .BR cmsg (3), | |
1092 | .BR capabilities (7), | |
1093 | .BR credentials (7), | |
170e5f0d JC |
1094 | .BR socket (7), |
1095 | .BR udp (7) |