-.\" $OpenBSD: getsockopt.2,v 1.61 2023/02/22 06:31:51 guenther Exp $
+.\" $OpenBSD: getsockopt.2,v 1.62 2024/04/02 14:23:15 claudio Exp $
.\" $NetBSD: getsockopt.2,v 1.7 1995/02/27 12:33:29 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\"
.\" @(#)getsockopt.2 8.3 (Berkeley) 4/19/94
.\"
-.Dd $Mdocdate: February 22 2023 $
+.Dd $Mdocdate: April 2 2024 $
.Dt GETSOCKOPT 2
.Os
.Sh NAME
get the domain of the socket (get only)
.It Dv SO_PROTOCOL
get the protocol of the socket (get only)
+.It Dv SO_ACCEPTCONN
+get listening status of the socket (get only)
.It Dv SO_PEERCRED
get the credentials from other side of connection (get only)
.El
.Dv SO_DOMAIN ,
.Dv SO_PROTOCOL ,
.Dv SO_ERROR ,
+.Dv SO_ACCEPTCONN ,
and
.Dv SO_PEERCRED
are options used only with
returns any pending error on the socket and clears the error status.
It may be used to check for asynchronous errors on connected
datagram sockets or for other asynchronous errors.
+.Dv SO_ACCEPTCONN
+returns whether the socket is currently accepting connections, that is,
+whether or not
+.Xr listen 2
+was called.
.Dv SO_PEERCRED
fetches the
.Va struct sockpeercred
-/* $OpenBSD: uipc_socket.c,v 1.326 2024/04/02 12:21:39 mvs Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.327 2024/04/02 14:23:15 claudio Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
case SO_REUSEPORT:
case SO_BROADCAST:
case SO_OOBINLINE:
+ case SO_ACCEPTCONN:
case SO_TIMESTAMP:
case SO_ZEROIZE:
*mtod(m, int *) = so->so_options & optname;