40 lines
964 B
Plaintext
40 lines
964 B
Plaintext
'\"macro stdmacro
|
|
.if n .pH g3N.cap_socket
|
|
.nr X
|
|
.if \nX=0 .ds x} CAP_SOCKET 3N "Capability Utility Functions" "\&"
|
|
.if \nX=1 .ds x} CAP_SOCKET 3N "Capability Utility Functions"
|
|
.if \nX=2 .ds x} CAP_SOCKET 3N "" "\&"
|
|
.if \nX=3 .ds x} CAP_SOCKET "" "" "\&"
|
|
.TH \*(x}
|
|
.SH NAME
|
|
.upperok
|
|
cap_socket \- create a socket with privilege
|
|
.SH SYNOPSIS
|
|
.B #include <cap_net.h>
|
|
.PP
|
|
.B "int cap_socket(int domain, int type, int protocol);"
|
|
.SH DESCRIPTION
|
|
.I cap_socket
|
|
asserts appropriate privilege for the creation of sockets with
|
|
privileged protocol types, like
|
|
.B SOCK_RAW
|
|
or
|
|
.B SOCK_IGMP .
|
|
.PP
|
|
If
|
|
.B _POSIX_CAP
|
|
is in effect, a process calling this function should have
|
|
.B CAP_NETWORK_MGT
|
|
capability in the permitted vector of its capability set.
|
|
.SH RETURN VALUES
|
|
.I cap_socket
|
|
returns a descriptor referencing the socket if successful, -1 otherwise.
|
|
.SH ERRORS
|
|
.I cap_socket
|
|
has the same error codes as
|
|
.IR socket (2).
|
|
.SH SEE ALSO
|
|
capability(4),
|
|
socket(2),
|
|
sysconf(3c).
|