2 .\" SPDX-License-Identifier: Linux-man-pages-1-para
4 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
5 .\" and copyright (c) 1999 Matthew Wilcox.
7 .\" 2002-10-30, Michael Kerrisk, <mtk.manpages@gmail.com>
8 .\" Added description of SO_ACCEPTCONN
9 .\" 2004-05-20, aeb, added SO_RCVTIMEO/SO_SNDTIMEO text.
10 .\" Modified, 27 May 2004, Michael Kerrisk <mtk.manpages@gmail.com>
11 .\" Added notes on capability requirements
12 .\" A few small grammar fixes
13 .\" 2010-06-13 Jan Engelhardt <jengelh@medozas.de>
14 .\" Documented SO_DOMAIN and SO_PROTOCOL.
17 .\" The following are not yet documented:
19 .\" SO_PEERNAME (2.4?)
21 .\" Seems to do something similar to getpeername(), but then
22 .\" why is it necessary / how does it differ?
24 .\" SO_TIMESTAMPING (2.6.30)
25 .\" Documentation/networking/timestamping.txt
26 .\" commit cb9eff097831007afb30d64373f29d99825d0068
27 .\" Author: Patrick Ohly <patrick.ohly@intel.com>
29 .\" SO_WIFI_STATUS (3.3)
30 .\" commit 6e3e939f3b1bf8534b32ad09ff199d88800835a0
31 .\" Author: Johannes Berg <johannes.berg@intel.com>
32 .\" Also: SCM_WIFI_STATUS
35 .\" commit 3bdc0eba0b8b47797f4a76e377dd8360f317450f
36 .\" Author: Ben Greear <greearb@candelatech.com>
38 .\" SO_GET_FILTER (3.8)
39 .\" commit a8fc92778080c845eaadc369a0ecf5699a03bef0
40 .\" Author: Pavel Emelyanov <xemul@parallels.com>
42 .\" SO_MAX_PACING_RATE (3.13)
43 .\" commit 62748f32d501f5d3712a7c372bbb92abc7c62bc7
44 .\" Author: Eric Dumazet <edumazet@google.com>
46 .\" SO_BPF_EXTENSIONS (3.14)
47 .\" commit ea02f9411d9faa3553ed09ce0ec9f00ceae9885e
48 .\" Author: Michal Sekletar <msekleta@redhat.com>
50 .TH socket 7 (date) "Linux man-pages (unreleased)"
52 socket \- Linux socket interface
55 .B #include <sys/socket.h>
57 .IB sockfd " = socket(int " socket_family ", int " socket_type ", int " protocol );
60 This manual page describes the Linux networking socket layer user
62 The BSD compatible sockets
63 are the uniform interface
64 between the user process and the network protocol stacks in the kernel.
65 The protocol modules are grouped into
68 .BR AF_INET ", " AF_IPX ", and " AF_PACKET ,
77 for more information on families and types.
78 .SS Socket-layer functions
79 These functions are used by the user process to send or receive packets
80 and to do other socket operations.
81 For more information, see their respective manual pages.
86 connects a socket to a remote socket address,
89 function binds a socket to a local socket address,
91 tells the socket that new connections shall be accepted, and
93 is used to get a new socket with a new incoming connection.
95 returns two connected anonymous sockets (implemented only for a few
103 send data over a socket, and
107 receive data from a socket.
111 wait for arriving data or a readiness to send data.
112 In addition, the standard I/O operations like
119 can be used to read and write data.
122 returns the local socket address and
124 returns the remote socket address.
128 are used to set or get socket layer or protocol options.
130 can be used to set or read some other options.
133 is used to close a socket.
135 closes parts of a full-duplex socket connection.
141 with a nonzero position is not supported on sockets.
143 It is possible to do nonblocking I/O on sockets by setting the
145 flag on a socket file descriptor using
147 Then all operations that would block will (usually)
150 (operation should be retried later);
155 The user can then wait for various events via
164 Event:Poll flag:Occurrence
169 A connection setup has been completed
170 (for connection-oriented sockets)
173 A disconnection request has been initiated by the other end.
176 A connection is broken (only for connection-oriented protocols).
177 When the socket is written
182 Socket has enough send buffer space for writing new data.
193 Read/Write:POLLERR:T{
194 An asynchronous error occurred.
196 Read/Write:POLLHUP:T{
197 The other end has shut down one direction.
204 .\" FIXME . The following is not true currently:
205 .\" It is no I/O event when the connection
206 .\" is broken from the local end using
216 is to let the kernel inform the application about events
222 flag must be set on a socket file descriptor via
224 and a valid signal handler for
226 must be installed via
231 .SS Socket address structures
232 Each socket domain has its own format for socket addresses,
233 with a domain-specific address structure.
234 Each of these structures begins with an
235 integer "family" field (typed as
237 that indicates the type of the address structure.
239 the various system calls (e.g.,
244 .BR getpeername (2)),
245 which are generic to all socket domains,
246 to determine the domain of a particular socket address.
248 To allow any type of socket address to be passed to
249 interfaces in the sockets API,
253 The purpose of this type is purely to allow casting of
254 domain-specific socket address types to a "generic" type,
255 so as to avoid compiler warnings about type mismatches in
256 calls to the sockets API.
258 In addition, the sockets API provides the data type
259 .IR "struct sockaddr_storage".
261 is suitable to accommodate all supported domain-specific socket
262 address structures; it is large enough and is aligned properly.
263 (In particular, it is large enough to hold
264 IPv6 socket addresses.)
265 The structure includes the following field, which can be used to identify
266 the type of socket address actually stored in the structure:
270 sa_family_t ss_family;
276 structure is useful in programs that must handle socket addresses
278 (e.g., programs that must deal with both IPv4 and IPv6 socket addresses).
280 The socket options listed below can be set by using
284 with the socket level set to
287 Unless otherwise noted,
292 .\" In the list below, the text used to describe argument types
293 .\" for each socket option should be more consistent
295 .\" SO_ACCEPTCONN is in POSIX.1-2001, and its origin is explained in
296 .\" W R Stevens, UNPv1
299 Returns a value indicating whether or not this socket has been marked
300 to accept connections with
302 The value 0 indicates that this is not a listening socket,
303 the value 1 indicates that this is a listening socket.
304 This socket option is read-only.
306 .BR SO_ATTACH_FILTER " (since Linux 2.2)"
308 .BR SO_ATTACH_BPF " (since Linux 3.19)"
310 .RB ( SO_ATTACH_FILTER )
312 .RB ( SO_ATTACH_BPF )
313 program to the socket for use as a filter of incoming packets.
314 A packet will be dropped if the filter program returns zero.
315 If the filter program returns a
316 nonzero value which is less than the packet's data length,
317 the packet will be truncated to the length returned.
318 If the value returned by the filter is greater than or equal to the
319 packet's data length, the packet is allowed to proceed unmodified.
325 structure, defined in
326 .IR <linux/filter.h> :
332 struct sock_filter *filter;
339 is a file descriptor returned by the
341 system call and must refer to a program of type
342 .BR BPF_PROG_TYPE_SOCKET_FILTER .
344 These options may be set multiple times for a given socket,
345 each time replacing the previous filter program.
346 The classic and extended versions may be called on the same socket,
347 but the previous filter will always be replaced such that a socket
348 never has more than one filter defined.
350 Both classic and extended BPF are explained in the kernel source file
351 .I Documentation/networking/filter.txt
353 .B SO_ATTACH_REUSEPORT_CBPF
355 .B SO_ATTACH_REUSEPORT_EBPF
358 option, these options allow the user to set a classic BPF
359 .RB ( SO_ATTACH_REUSEPORT_CBPF )
361 .RB ( SO_ATTACH_REUSEPORT_EBPF )
362 program which defines how packets are assigned to
363 the sockets in the reuseport group (that is, all sockets which have
365 set and are using the same local address to receive packets).
367 The BPF program must return an index between 0 and N\-1 representing
368 the socket which should receive the packet
369 (where N is the number of sockets in the group).
370 If the BPF program returns an invalid index,
371 socket selection will fall back to the plain
375 Sockets are numbered in the order in which they are added to the group
376 (that is, the order of
378 calls for UDP sockets or the order of
380 calls for TCP sockets).
381 New sockets added to a reuseport group will inherit the BPF program.
382 When a socket is removed from a reuseport group (via
384 the last socket in the group will be moved into the closed socket's
387 These options may be set repeatedly at any time on any socket in the group
388 to replace the current BPF program used by all sockets in the group.
390 .B SO_ATTACH_REUSEPORT_CBPF
391 takes the same argument type as
394 .B SO_ATTACH_REUSEPORT_EBPF
395 takes the same argument type as
398 UDP support for this feature is available since Linux 4.5;
399 TCP support is available since Linux 4.6.
402 Bind this socket to a particular device like \[lq]eth0\[rq],
403 as specified in the passed interface name.
405 name is an empty string or the option length is zero, the socket device
407 The passed option is a variable-length null-terminated
408 interface name string with the maximum size of
410 If a socket is bound to an interface,
411 only packets received from that particular interface are processed by the
413 Note that this works only for some socket types, particularly
416 It is not supported for packet sockets (use normal
421 this socket option could be set, but could not retrieved with
423 Since Linux 3.8, it is readable.
426 argument should contain the buffer size available
427 to receive the device name and is recommended to be
430 The real device name length is reported back in the
435 Set or get the broadcast flag.
436 When enabled, datagram sockets are allowed to send
437 packets to a broadcast address.
438 This option has no effect on stream-oriented sockets.
441 Enable BSD bug-to-bug compatibility.
442 This is used by the UDP protocol module in Linux 2.0 and 2.2.
443 If enabled, ICMP errors received for a UDP socket will not be passed
445 In later kernel versions, support for this option has been phased out:
446 Linux 2.4 silently ignores it, and Linux 2.6 generates a kernel warning
447 (printk()) if a program uses this option.
448 Linux 2.0 also enabled BSD bug-to-bug compatibility
449 options (random header changing, skipping of the broadcast flag) for raw
450 sockets with this option, but that was removed in Linux 2.2.
453 Enable socket debugging.
454 Allowed only for processes with the
456 capability or an effective user ID of 0.
458 .BR SO_DETACH_FILTER " (since Linux 2.2)"
460 .BR SO_DETACH_BPF " (since Linux 3.19)"
461 These two options, which are synonyms,
462 may be used to remove the classic or extended BPF
463 program attached to a socket with either
467 The option value is ignored.
469 .BR SO_DOMAIN " (since Linux 2.6.32)"
470 Retrieves the socket domain as an integer, returning a value such as
475 This socket option is read-only.
478 Get and clear the pending socket error.
479 This socket option is read-only.
483 Don't send via a gateway, send only to directly connected hosts.
484 The same effect can be achieved by setting the
489 Expects an integer boolean flag.
491 .BR SO_INCOMING_CPU " (gettable since Linux 3.19, settable since Linux 4.4)"
492 .\" getsockopt 2c8c56e15df3d4c2af3d656e44feb18789f75837
493 .\" setsockopt 70da268b569d32a9fddeea85dc18043de9d89f89
494 Sets or gets the CPU affinity of a socket.
495 Expects an integer flag.
500 setsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu,
505 Because all of the packets for a single stream
506 (i.e., all packets for the same 4-tuple)
507 arrive on the single RX queue that is associated with a particular CPU,
508 the typical use case is to employ one listening process per RX queue,
509 with the incoming flow being handled by a listener
510 on the same CPU that is handling the RX queue.
511 This provides optimal NUMA behavior and keeps CPU caches hot.
513 .\" From an email conversation with Eric Dumazet:
514 .\" >> Note that setting the option is not supported if SO_REUSEPORT is used.
516 .\" > Please define "not supported". Does this yield an API diagnostic?
517 .\" > If so, what is it?
519 .\" >> Socket will be selected from an array, either by a hash or BPF program
520 .\" >> that has no access to this information.
522 .\" > Sorry -- I'm lost here. How does this comment relate to the proposed
523 .\" > man page text above?
527 .\" If an application uses both SO_INCOMING_CPU and SO_REUSEPORT, then
528 .\" SO_REUSEPORT logic, selecting the socket to receive the packet, ignores
529 .\" SO_INCOMING_CPU setting.
531 .BR SO_INCOMING_NAPI_ID " (gettable since Linux 4.12)"
532 .\" getsockopt 6d4339028b350efbf87c61e6d9e113e5373545c9
533 Returns a system-level unique ID called NAPI ID that is associated
534 with a RX queue on which the last packet associated with that
537 This can be used by an application to split the incoming flows among worker
538 threads based on the RX queue on which the packets associated with the
540 It allows each worker thread to be associated with
541 a NIC HW receive queue and service all the connection
542 requests received on that RX queue.
543 This mapping between an app thread and
544 a HW NIC queue streamlines the
545 flow of data from the NIC to the application.
548 Enable sending of keep-alive messages on connection-oriented sockets.
549 Expects an integer boolean flag.
562 int l_onoff; /* linger active */
563 int l_linger; /* how many seconds to linger for */
572 will not return until all queued messages for the socket have been
573 successfully sent or the linger timeout has been reached.
575 the call returns immediately and the closing is done in the background.
576 When the socket is closed as part of
578 it always lingers in the background.
581 .\" commit d59577b6ffd313d0ab3be39cb1ab47e29bdc9182
582 When set, this option will prevent
583 changing the filters associated with the socket.
584 These filters include any set using the socket options
585 .BR SO_ATTACH_FILTER ,
587 .BR SO_ATTACH_REUSEPORT_CBPF ,
589 .BR SO_ATTACH_REUSEPORT_EBPF .
591 The typical use case is for a privileged process to set up a raw socket
592 (an operation that requires the
594 capability), apply a restrictive filter, set the
597 and then either drop its privileges or pass the socket file descriptor
598 to an unprivileged process via a UNIX domain socket.
602 option has been enabled, attempts to change or remove the filter
603 attached to a socket, or to disable the
605 option will fail with the error
608 .BR SO_MARK " (since Linux 2.6.25)"
609 .\" commit 4a19ec5800fc3bb64e2d87c4d9fdd9e636086fe0
610 .\" and 914a9ab386a288d0f22252fc268ecbc048cdcbd5
611 Set the mark for each packet sent through this socket
612 (similar to the netfilter MARK target but socket-based).
613 Changing the mark can be used for mark-based
614 routing without netfilter or for packet filtering.
615 Setting this option requires the
619 (since Linux 5.17) capability.
622 If this option is enabled,
623 out-of-band data is directly placed into the receive data stream.
624 Otherwise, out-of-band data is passed only when the
626 flag is set during receiving.
627 .\" don't document it because it can do too much harm.
629 .\" The kernel has support for the SO_NO_CHECK socket
630 .\" option (boolean: 0 == default, calculate checksum on xmit,
631 .\" 1 == do not calculate checksum on xmit).
632 .\" Additional note from Andi Kleen on SO_NO_CHECK (2010-08-30)
633 .\" On Linux UDP checksums are essentially free and there's no reason
634 .\" to turn them off and it would disable another safety line.
635 .\" That is why I didn't document the option.
638 Enable or disable the receiving of the
641 For more information, see
645 Enable or disable the receiving of the
648 For more information, see
651 .BR SO_PEEK_OFF " (since Linux 3.4)"
652 .\" commit ef64a54f6e558155b4f149bb10666b9e914b6c54
653 This option, which is currently supported only for
655 sockets, sets the value of the "peek offset" for the
657 system call when used with
661 When this option is set to a negative value
662 (it is set to \-1 for all new sockets),
663 traditional behavior is provided:
667 flag will peek data from the front of the queue.
669 When the option is set to a value greater than or equal to zero,
670 then the next peek at data queued in the socket will occur at
671 the byte offset specified by the option value.
672 At the same time, the "peek offset" will be
673 incremented by the number of bytes that were peeked from the queue,
674 so that a subsequent peek will return the next data in the queue.
676 If data is removed from the front of the queue via a call to
678 (or similar) without the
680 flag, the "peek offset" will be decreased by the number of bytes removed.
681 In other words, receiving data without the
683 flag will cause the "peek offset" to be adjusted to maintain
684 the correct relative position in the queued data,
685 so that a subsequent peek will retrieve the data that would have been
686 retrieved had the data not been removed.
688 For datagram sockets, if the "peek offset" points to the middle of a packet,
689 the data returned will be marked with the
693 The following example serves to illustrate the use of
695 Suppose a stream socket has the following queued input data:
703 The following sequence of
705 calls would have the effect noted in the comments:
709 int ov = 4; // Set peek offset to 4
710 setsockopt(fd, SOL_SOCKET, SO_PEEK_OFF, &ov, sizeof(ov));
712 recv(fd, buf, 2, MSG_PEEK); // Peeks "cc"; offset set to 6
713 recv(fd, buf, 2, MSG_PEEK); // Peeks "dd"; offset set to 8
714 recv(fd, buf, 2, 0); // Reads "aa"; offset set to 6
715 recv(fd, buf, 2, MSG_PEEK); // Peeks "ee"; offset set to 8
720 Return the credentials of the peer process connected to this socket.
721 For further details, see
724 .BR SO_PEERSEC " (since Linux 2.6.2)"
725 Return the security context of the peer socket connected to this socket.
726 For further details, see
732 Set the protocol-defined priority for all packets to be sent on
734 Linux uses this value to order the networking queues:
735 packets with a higher priority may be processed first depending
736 on the selected device queueing discipline.
739 .\" this also sets the IP type-of-service (TOS) field for outgoing packets.
740 Setting a priority outside the range 0 to 6 requires the
744 .BR SO_PROTOCOL " (since Linux 2.6.32)"
745 Retrieves the socket protocol as an integer, returning a value such as
750 This socket option is read-only.
753 Sets or gets the maximum socket receive buffer in bytes.
754 The kernel doubles this value (to allow space for bookkeeping overhead)
756 .\" Most (all?) other implementations do not do this -- MTK, Dec 05
758 and this doubled value is returned by
760 .\" The following thread on LMKL is quite informative:
761 .\" getsockopt/setsockopt with SO_RCVBUF and SO_SNDBUF "non-standard" behavior
763 .\" http://thread.gmane.org/gmane.linux.kernel/1328935
764 The default value is set by the
765 .I /proc/sys/net/core/rmem_default
766 file, and the maximum allowed value is set by the
767 .I /proc/sys/net/core/rmem_max
769 The minimum (doubled) value for this option is 256.
771 .BR SO_RCVBUFFORCE " (since Linux 2.6.14)"
772 Using this socket option, a privileged
773 .RB ( CAP_NET_ADMIN )
774 process can perform the same task as
778 limit can be overridden.
783 Specify the minimum number of bytes in the buffer until the socket layer
784 will pass the data to the protocol
786 or the user on receiving
788 These two values are initialized to 1.
790 is not changeable on Linux
796 only since Linux 2.4.
799 .\" Tested on kernel 2.6.14 -- mtk, 30 Nov 05
807 and indicated a socket as readable when even a single byte of data
809 A subsequent read from the socket would then block until
813 .\" commit c7004482e8dcb7c3c72666395cfa98a216a4fb70
818 indicate a socket as readable only if at least
825 .\" Not implemented in Linux 2.0.
826 .\" Implemented in Linux 2.1.11 for getsockopt: always return a zero struct.
827 .\" Implemented in Linux 2.3.41 for setsockopt, and actually used.
828 Specify the receiving or sending timeouts until reporting an error.
830 .IR "struct timeval" .
831 If an input or output function blocks for this period of time, and
832 data has been sent or received, the return value of that function
833 will be the amount of data transferred; if no data has been transferred
834 and the timeout has been reached, then \-1 is returned with
840 .\" in fact to EAGAIN
845 just as if the socket was specified to be nonblocking.
846 If the timeout is set to zero (the default),
847 then the operation will never timeout.
848 Timeouts only have effect for system calls that perform socket I/O (e.g.,
855 timeouts have no effect for
862 .\" commit c617f398edd4db2b8567a28e899a88f8f574798d
863 .\" https://lwn.net/Articles/542629/
864 Indicates that the rules used in validating addresses supplied in a
866 call should allow reuse of local addresses.
870 means that a socket may bind, except when there
871 is an active listening socket bound to the address.
872 When the listening socket is bound to
874 with a specific port then it is not possible
875 to bind to this port for any local address.
876 Argument is an integer boolean flag.
878 .BR SO_REUSEPORT " (since Linux 3.9)"
883 sockets to be bound to an identical socket address.
884 This option must be set on each socket (including the first socket)
888 To prevent port hijacking,
889 all of the processes binding to the same address must have the same
891 This option can be employed with both TCP and UDP sockets.
893 For TCP sockets, this option allows
895 load distribution in a multi-threaded server to be improved by
896 using a distinct listener socket for each thread.
897 This provides improved load distribution as compared
898 to traditional techniques such using a single
900 thread that distributes connections,
901 or having multiple threads that compete to
903 from the same socket.
906 the use of this option can provide better distribution
907 of incoming datagrams to multiple processes (or threads) as compared
908 to the traditional technique of having multiple processes
909 compete to receive datagrams on the same socket.
911 .BR SO_RXQ_OVFL " (since Linux 2.6.33)"
912 .\" commit 3b885787ea4112eaa80945999ea0901bf742707f
913 Indicates that an unsigned 32-bit value ancillary message (cmsg)
914 should be attached to received skbs indicating
915 the number of packets dropped by the socket since its creation.
917 .BR SO_SELECT_ERR_QUEUE " (since Linux 3.10)"
918 .\" commit 7d4c04fc170087119727119074e72445f2bb192b
919 .\" Author: Keller, Jacob E <jacob.e.keller@intel.com>
920 When this option is set on a socket,
921 an error condition on a socket causes notification not only via the
932 .\" It does not affect wake up.
934 Background: this option was added when waking up on an error condition
935 occurred only via the
941 The option was added to allow monitoring for error conditions via the
943 argument without simultaneously having to receive notifications (via
945 for regular data that can be read from the socket.
946 After changes in Linux 4.16,
947 .\" commit 6e5d58fdc9bedd0255a8
948 .\" ("skbuff: Fix not waking applications when errors are enqueued")
949 the use of this flag to achieve the desired notifications
950 is no longer necessary.
951 This option is nevertheless retained for backwards compatibility.
954 Sets or gets the maximum socket send buffer in bytes.
955 The kernel doubles this value (to allow space for bookkeeping overhead)
957 .\" Most (all?) other implementations do not do this -- MTK, Dec 05
958 .\" See also the comment to SO_RCVBUF (17 Jul 2012 LKML mail)
960 and this doubled value is returned by
962 The default value is set by the
963 .I /proc/sys/net/core/wmem_default
964 file and the maximum allowed value is set by the
965 .I /proc/sys/net/core/wmem_max
967 The minimum (doubled) value for this option is 2048.
969 .BR SO_SNDBUFFORCE " (since Linux 2.6.14)"
970 Using this socket option, a privileged
971 .RB ( CAP_NET_ADMIN )
972 process can perform the same task as
976 limit can be overridden.
979 Enable or disable the receiving of the
982 The timestamp control message is sent with level
993 reception time of the last packet passed to the user in this call.
996 for details on control messages.
998 .BR SO_TIMESTAMPNS " (since Linux 2.6.22)"
999 .\" commit 92f37fd2ee805aa77925c1e64fd56088b46094fc
1000 Enable or disable the receiving of the
1003 The timestamp control message is sent with level
1008 .BR SCM_TIMESTAMPNS .
1012 .I "struct timespec"
1014 reception time of the last packet passed to the user in this call.
1015 The clock used for the timestamp is
1016 .BR CLOCK_REALTIME .
1019 for details on control messages.
1024 .BR SO_TIMESTAMPNS :
1025 the two modes are mutually exclusive.
1028 Gets the socket type as an integer (e.g.,
1030 This socket option is read-only.
1032 .BR SO_BUSY_POLL " (since Linux 3.11)"
1033 Sets the approximate time in microseconds to busy poll on a blocking receive
1034 when there is no data.
1035 Increasing this value requires
1037 The default for this option is controlled by the
1038 .I /proc/sys/net/core/busy_read
1042 .I /proc/sys/net/core/busy_poll
1043 file determines how long
1047 will busy poll when they operate on sockets with
1049 set and no events to report are found.
1052 busy polling will only be done when the socket last received data
1053 from a network device that supports this option.
1055 While busy polling may improve latency of some applications,
1056 care must be taken when using it since this will increase
1057 both CPU utilization and power usage.
1059 When writing onto a connection-oriented socket that has been shut down
1060 (by the local or the remote end)
1062 is sent to the writing process and
1065 The signal is not sent when the write call
1070 When requested with the
1077 is sent when an I/O event occurs.
1078 It is possible to use
1082 in the signal handler to find out which socket the event occurred on.
1083 An alternative (in Linux 2.2) is to set a real-time signal using the
1086 the handler of the real time signal will be called with
1087 the file descriptor in the
1093 for more information.
1095 Under some circumstances (e.g., multiple processes accessing a
1096 single socket), the condition that caused the
1098 may have already disappeared when the process reacts to the signal.
1099 If this happens, the process should wait again because Linux
1100 will resend the signal later.
1101 .\" .SS Ancillary messages
1102 .SS /proc interfaces
1103 The core socket networking parameters can be accessed
1104 via files in the directory
1105 .IR /proc/sys/net/core/ .
1108 contains the default setting in bytes of the socket receive buffer.
1111 contains the maximum socket receive buffer size in bytes which a user may
1117 contains the default setting in bytes of the socket send buffer.
1120 contains the maximum socket send buffer size in bytes which a user may
1128 configure the token bucket filter used to load limit warning messages
1129 caused by external network events.
1131 .I netdev_max_backlog
1132 Maximum number of packets in the global input queue.
1135 Maximum length of ancillary data and user control data like the iovecs
1137 .\" netdev_fastroute is not documented because it is experimental
1139 These operations can be accessed using
1144 .IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");"
1151 with the receive timestamp of the last packet passed to the user.
1152 This is useful for accurate round trip time measurements.
1155 for a description of
1156 .IR "struct timeval" .
1158 This ioctl should be used only if the socket options
1162 are not set on the socket.
1163 Otherwise, it returns the timestamp of the
1164 last packet that was received while
1168 were not set, or it fails if no such packet has been received,
1177 Set the process or process group that is to receive
1181 signals when I/O becomes possible or urgent data is available.
1182 The argument is a pointer to a
1184 For further details, see the description of
1192 flag to enable or disable asynchronous I/O mode of the socket.
1193 Asynchronous I/O mode means that the
1195 signal or the signal set with
1197 is raised when a new I/O event occurs.
1199 Argument is an integer boolean flag.
1200 (This operation is synonymous with the use of
1208 Get the current process or process group that receives
1231 was introduced in Linux 2.0.30.
1233 is new in Linux 2.2.
1236 interfaces were introduced in Linux 2.2.
1240 are supported since Linux 2.3.41.
1241 Earlier, timeouts were fixed to
1242 a protocol-specific setting, and could not be read or written.
1244 Linux assumes that half of the send/receive buffer is used for internal
1245 kernel structures; thus the values in the corresponding
1247 files are twice what can be observed on the wire.
1249 Linux will allow port reuse only with the
1252 when this option was set both in the previous program that performed a
1254 to the port and in the program that wants to reuse the port.
1255 This differs from some implementations (e.g., FreeBSD)
1256 where only the later program needs to set the
1259 Typically this difference is invisible, since, for example, a server
1260 program is designed to always set this option.
1262 .\" This man page was written by Andi Kleen.
1271 .BR address_families (7),
1272 .BR capabilities (7),