GETSOCKOPT(2)GETSOCKOPT(2)NAMEgetsockopt - get the value of a socket option.
SYNOPSIS
#include <sys/socket.h>
int getsockopt(int sd, int level, int opt_name, void * opt_val,
socklen_t * opt_len);
DESCRIPTIONgetsockopt() provides an interface to get the value of a specific
option, referenced by opt_name, for a given socket descriptor sd.
RETURN VALUES
On success, this function returns 0. On error, -1 is returned and errno
is set.
ERRORS
[ENOSYS] The option opt_name is not available/supported at the
level specified for the socket sd.
[ENOTSOCK] sd is not a socket descriptor.
SEE ALSOsocket(2), socketpair(2), setsockopt(2)GETSOCKOPT(2)