cap_bind - bind a privileged name to a socket
int cap_bind(int s, const struct sockaddr *name,
cap_bind asserts appropriate privilege when assigning a name to a socket.
This is necessary when a process wishes to bind an Internet Domain socket
to a port whose numeric value is less than 1024, for example.
If _POSIX_CAP is in effect, a process calling this function should have
CAP_PRIV_PORT capability in the permitted vector of its capability set.
cap_bind returns 0 if successful, -1 otherwise.
cap_bind has the same error codes as bind(2).
capability(4), bind(2), sysconf(3c).
PPPPaaaaggggeeee 1111 [ Back ]