CAP_BIND(3N)CAP_BIND(3N)NAMEcap_bind - bind a privileged name to a socket
SYNOPSIS
#include <cap_net.h>
int cap_bind(int s, const struct sockaddr *name,
int namelen);
DESCRIPTIONcap_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.
RETURN VALUEScap_bind returns 0 if successful, -1 otherwise.
ERRORScap_bind has the same error codes as bind(2).
SEE ALSOcapability(4), bind(2), sysconf(3c).
Page 1