cap_socket(3N)

cap_socket - create a socket with privilege

As shipped in IRIX 6.5.22. Unchanged since IRIX 6.5.

NAME
     cap_socket - create a socket with privilege

SYNOPSIS
     #include <cap_net.h>

     int cap_socket(int domain, int type, int protocol);

DESCRIPTION
     cap_socket asserts appropriate privilege for the creation of sockets with
     privileged protocol types, like SOCK_RAW or SOCK_IGMP .

     If _POSIX_CAP is in effect, a process calling this function should have
     CAP_NETWORK_MGT capability in the permitted vector of its capability set.

RETURN VALUES
     cap_socket returns a descriptor referencing the socket if successful, -1
     otherwise.

ERRORS
     cap_socket has the same error codes as socket(2).

SEE ALSO
     capability(4), socket(2), sysconf(3c).