Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/getsockopt.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 | .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 11, 2019 | .Dd June 03, 2020 | ||||
.Dt GETSOCKOPT 2 | .Dt GETSOCKOPT 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm getsockopt , | .Nm getsockopt , | ||||
.Nm setsockopt | .Nm setsockopt | ||||
.Nd get and set options on sockets | .Nd get and set options on sockets | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | |||||
.It Dv SO_LABEL Ta "get MAC label of the socket (get only)" | .It Dv SO_LABEL Ta "get MAC label of the socket (get only)" | ||||
.It Dv SO_PEERLABEL Ta "get socket's peer's MAC label (get only)" | .It Dv SO_PEERLABEL Ta "get socket's peer's MAC label (get only)" | ||||
.It Dv SO_LISTENQLIMIT Ta "get backlog limit of the socket (get only)" | .It Dv SO_LISTENQLIMIT Ta "get backlog limit of the socket (get only)" | ||||
.It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)" | .It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)" | ||||
.It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" | .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" | ||||
.It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" | .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" | ||||
.It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" | .It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" | ||||
.It Dv SO_MAX_PACING_RATE Ta "set the maximum transmit rate in bytes per second for the socket" | .It Dv SO_MAX_PACING_RATE Ta "set the maximum transmit rate in bytes per second for the socket" | ||||
.It Dv SO_NO_OFFLOAD Ta "disables protocol offloads" | |||||
.It Dv SO_NO_DDP Ta "disables direct data placement offload" | |||||
.El | .El | ||||
.Pp | .Pp | ||||
.Dv SO_DEBUG | .Dv SO_DEBUG | ||||
enables debugging in the underlying protocol modules. | enables debugging in the underlying protocol modules. | ||||
.Pp | .Pp | ||||
.Dv SO_REUSEADDR | .Dv SO_REUSEADDR | ||||
indicates that the rules used in validating addresses supplied | indicates that the rules used in validating addresses supplied | ||||
in a | in a | ||||
▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | |||||
.Dv AF_INET6 | .Dv AF_INET6 | ||||
address families. | address families. | ||||
.Dv SO_ERROR | .Dv SO_ERROR | ||||
returns any pending error on the socket and clears | returns any pending error on the socket and clears | ||||
the error status. | the error status. | ||||
It may be used to check for asynchronous errors on connected | It may be used to check for asynchronous errors on connected | ||||
datagram sockets or for other asynchronous errors. | datagram sockets or for other asynchronous errors. | ||||
.Pp | .Pp | ||||
Finally, | |||||
.Dv SO_LABEL | .Dv SO_LABEL | ||||
returns the MAC label of the socket. | returns the MAC label of the socket. | ||||
.Dv SO_PEERLABEL | .Dv SO_PEERLABEL | ||||
returns the MAC label of the socket's peer. | returns the MAC label of the socket's peer. | ||||
Note that your kernel must be compiled with MAC support. | Note that your kernel must be compiled with MAC support. | ||||
See | See | ||||
.Xr mac 3 | .Xr mac 3 | ||||
for more information. | for more information. | ||||
.Pp | |||||
.Dv SO_LISTENQLIMIT | .Dv SO_LISTENQLIMIT | ||||
returns the maximal number of queued connections, as set by | returns the maximal number of queued connections, as set by | ||||
.Xr listen 2 . | .Xr listen 2 . | ||||
.Dv SO_LISTENQLEN | .Dv SO_LISTENQLEN | ||||
returns the number of unaccepted complete connections. | returns the number of unaccepted complete connections. | ||||
.Dv SO_LISTENINCQLEN | .Dv SO_LISTENINCQLEN | ||||
returns the number of unaccepted incomplete connections. | returns the number of unaccepted incomplete connections. | ||||
.Pp | .Pp | ||||
.Dv SO_MAX_PACING_RATE | .Dv SO_MAX_PACING_RATE | ||||
instruct the socket and underlying network adapter layers to limit the | instruct the socket and underlying network adapter layers to limit the | ||||
transfer rate to the given unsigned 32-bit value in bytes per second. | transfer rate to the given unsigned 32-bit value in bytes per second. | ||||
.Pp | |||||
.Dv SO_NO_OFFLOAD | |||||
disables support for protocol offloads. | |||||
At present, this prevents TCP sockets from using TCP offload engines. | |||||
.Dv SO_NO_DDP | |||||
disables support for a specific TCP offload known as direct data | |||||
placement (DDP). | |||||
DDP is an offload supported by Chelsio network adapters that permits | |||||
reassembled TCP data streams to be received via zero-copy in | |||||
user-supplied buffers using | |||||
.Xr aio_read 2 . | |||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Rv -std | .Rv -std | ||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
.Fn getsockopt | .Fn getsockopt | ||||
and | and | ||||
.Fn setsockopt | .Fn setsockopt | ||||
system calls succeed unless: | system calls succeed unless: | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |