.Fd #include <sys/types.h>
.Fd #include <sys/socket.h>
.Ft int
-.Fn getsockopt "int s" "int level" "int optname" "void *optval" "int *optlen"
+.Fn getsockopt "int s" "int level" "int optname" "void *optval" "socklen_t *optlen"
.Ft int
-.Fn setsockopt "int s" "int level" "int optname" "const void *optval" "int optlen"
+.Fn setsockopt "int s" "int level" "int optname" "const void *optval" "socklen_t optlen"
.Sh DESCRIPTION
.Fn Getsockopt
and
receiving additional data, it returns with a short count
or with the error
.Er EWOULDBLOCK
-if no data were received.
+if no data were received. The struct timeval parameter must represent a
+positive time interval otherwise
+.Fn setsockopt
+returns with the error
+.Er EDOM .
.Pp
.Dv SO_NOSIGPIPE is an option that prevents SIGPIPE from being raised
when a write fails on a socket to which there is no reader;
this error may also be returned if
.Fa optlen
is not in a valid part of the process address space.
+.It Bq Er EDOM
+The argument value is out of bounds.
.El
.Sh SEE ALSO
.Xr ioctl 2 ,