GETSOCKOPT(2)

NAME
getsockopt - 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);

DESCRIPTION
getsockopt() 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 ALSO
socket(2), socketpair(2), setsockopt(2)