Deleted Added
full compact
getsockopt.2 (123814) getsockopt.2 (131504)
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95
33.\" $FreeBSD: head/lib/libc/sys/getsockopt.2 123814 2003-12-24 18:52:41Z alfred $
33.\" $FreeBSD: head/lib/libc/sys/getsockopt.2 131504 2004-07-02 23:52:20Z ru $
34.\"
35.Dd May 2, 1995
36.Dt GETSOCKOPT 2
37.Os
38.Sh NAME
39.Nm getsockopt ,
40.Nm setsockopt
41.Nd get and set options on sockets

--- 9 unchanged lines hidden (view full) ---

51.Sh DESCRIPTION
52The
53.Fn getsockopt
54and
55.Fn setsockopt
56system calls
57manipulate the
58.Em options
34.\"
35.Dd May 2, 1995
36.Dt GETSOCKOPT 2
37.Os
38.Sh NAME
39.Nm getsockopt ,
40.Nm setsockopt
41.Nd get and set options on sockets

--- 9 unchanged lines hidden (view full) ---

51.Sh DESCRIPTION
52The
53.Fn getsockopt
54and
55.Fn setsockopt
56system calls
57manipulate the
58.Em options
59associated with a socket. Options may exist at multiple
59associated with a socket.
60Options may exist at multiple
60protocol levels; they are always present at the uppermost
61.Dq socket
62level.
63.Pp
64When manipulating socket options the level at which the
65option resides and the name of the option must be specified.
66To manipulate options at the socket level,
67.Fa level
68is specified as
69.Dv SOL_SOCKET .
70To manipulate options at any
71other level the protocol number of the appropriate protocol
61protocol levels; they are always present at the uppermost
62.Dq socket
63level.
64.Pp
65When manipulating socket options the level at which the
66option resides and the name of the option must be specified.
67To manipulate options at the socket level,
68.Fa level
69is specified as
70.Dv SOL_SOCKET .
71To manipulate options at any
72other level the protocol number of the appropriate protocol
72controlling the option is supplied. For example,
73controlling the option is supplied.
74For example,
73to indicate that an option is to be interpreted by the
74.Tn TCP
75protocol,
76.Fa level
77should be set to the protocol number of
78.Tn TCP ;
79see
80.Xr getprotoent 3 .
81.Pp
82The
83.Fa optval
84and
85.Fa optlen
86arguments
87are used to access option values for
88.Fn setsockopt .
89For
90.Fn getsockopt
91they identify a buffer in which the value for the
75to indicate that an option is to be interpreted by the
76.Tn TCP
77protocol,
78.Fa level
79should be set to the protocol number of
80.Tn TCP ;
81see
82.Xr getprotoent 3 .
83.Pp
84The
85.Fa optval
86and
87.Fa optlen
88arguments
89are used to access option values for
90.Fn setsockopt .
91For
92.Fn getsockopt
93they identify a buffer in which the value for the
92requested option(s) are to be returned. For
94requested option(s) are to be returned.
95For
93.Fn getsockopt ,
94.Fa optlen
95is a value-result argument, initially containing the
96size of the buffer pointed to by
97.Fa optval ,
98and modified on return to indicate the actual size of
96.Fn getsockopt ,
97.Fa optlen
98is a value-result argument, initially containing the
99size of the buffer pointed to by
100.Fa optval ,
101and modified on return to indicate the actual size of
99the value returned. If no option value is
102the value returned.
103If no option value is
100to be supplied or returned,
101.Fa optval
102may be NULL.
103.Pp
104The
105.Fa optname
106argument
107and any specified options are passed uninterpreted to the appropriate

--- 66 unchanged lines hidden (view full) ---

174allows completely duplicate bindings by multiple processes
175if they all set
176.Dv SO_REUSEPORT
177before binding the port.
178This option permits multiple instances of a program to each
179receive UDP/IP multicast or broadcast datagrams destined for the bound port.
180.Dv SO_KEEPALIVE
181enables the
104to be supplied or returned,
105.Fa optval
106may be NULL.
107.Pp
108The
109.Fa optname
110argument
111and any specified options are passed uninterpreted to the appropriate

--- 66 unchanged lines hidden (view full) ---

178allows completely duplicate bindings by multiple processes
179if they all set
180.Dv SO_REUSEPORT
181before binding the port.
182This option permits multiple instances of a program to each
183receive UDP/IP multicast or broadcast datagrams destined for the bound port.
184.Dv SO_KEEPALIVE
185enables the
182periodic transmission of messages on a connected socket. Should the
186periodic transmission of messages on a connected socket.
187Should the
183connected party fail to respond to these messages, the connection is
184considered broken and processes using the socket are notified via a
185.Dv SIGPIPE
186signal when attempting to send data.
187.Dv SO_DONTROUTE
188indicates that outgoing messages should
188connected party fail to respond to these messages, the connection is
189considered broken and processes using the socket are notified via a
190.Dv SIGPIPE
191signal when attempting to send data.
192.Dv SO_DONTROUTE
193indicates that outgoing messages should
189bypass the standard routing facilities. Instead, messages are directed
194bypass the standard routing facilities.
195Instead, messages are directed
190to the appropriate network interface according to the network portion
191of the destination address.
192.Pp
193.Dv SO_LINGER
194controls the action taken when unsent messages
195are queued on socket and a
196.Xr close 2
197is performed.

--- 214 unchanged lines hidden ---
196to the appropriate network interface according to the network portion
197of the destination address.
198.Pp
199.Dv SO_LINGER
200controls the action taken when unsent messages
201are queued on socket and a
202.Xr close 2
203is performed.

--- 214 unchanged lines hidden ---