42 lines
1.0 KiB
Plaintext
42 lines
1.0 KiB
Plaintext
'\"macro stdmacro
|
|
.if n .pH g3N.cap_bind
|
|
.nr X
|
|
.if \nX=0 .ds x} CAP_BIND 3N "Capability Utility Functions" "\&"
|
|
.if \nX=1 .ds x} CAP_BIND 3N "Capability Utility Functions"
|
|
.if \nX=2 .ds x} CAP_BIND 3N "" "\&"
|
|
.if \nX=3 .ds x} CAP_BIND "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
.upperok
|
|
cap_bind \- bind a privileged name to a socket
|
|
.SH SYNOPSIS
|
|
.B #include <cap_net.h>
|
|
.PP
|
|
.B "int cap_bind(int s, const struct sockaddr *name,"
|
|
.br
|
|
.B " int namelen);"
|
|
.SH DESCRIPTION
|
|
.I 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
|
|
.IR 1024 ,
|
|
for example.
|
|
.PP
|
|
If
|
|
.B _POSIX_CAP
|
|
is in effect, a process calling this function should have
|
|
.B CAP_PRIV_PORT
|
|
capability in the permitted vector of its capability set.
|
|
.SH RETURN VALUES
|
|
.I cap_bind
|
|
returns 0 if successful, -1 otherwise.
|
|
.SH ERRORS
|
|
.I cap_bind
|
|
has the same error codes as
|
|
.IR bind (2).
|
|
.SH SEE ALSO
|
|
capability(4),
|
|
bind(2),
|
|
sysconf(3c).
|