rcmd.3: Add some details of the rresvport() 'port' argument

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-04-23 11:15:45 +12:00
parent 7cb4d005c6
commit aa104c88b7
1 changed files with 14 additions and 4 deletions

View File

@ -38,7 +38,7 @@
.\"
.\" 2007-12-08, mtk, Converted from mdoc to man macros
.\"
.TH RCMD 3 2012-03-29 "Linux" "Linux Programmer's Manual"
.TH RCMD 3 2012-04-23 "Linux" "Linux Programmer's Manual"
.SH NAME
rcmd, rresvport, iruserok, ruserok \- routines for returning a
stream to a remote command
@ -140,12 +140,22 @@ The protocol is described in detail in
The
.BR rresvport ()
function is used to obtain a socket with a privileged
address bound to it.
port bound to it.
This socket is suitable for use by
.BR rcmd ()
and several other functions.
Privileged Internet ports are those in the range 0 to 1023.
Only the superuser is allowed to bind an address of this sort to a socket.
Privileged ports are those in the range 0 to 1023.
Only a privileged process
.RB ( CAP_NET_BIND_SERVICE )
is allowed to bind to a privileged port.
In the glibc implementation,
this function restricts its search to the ports from 512 to 1023.
The
.I port
argument is value-result:
the value it supplies to the call is used as the starting point
for a circular search of the port range;
on (successful) return, it contains the port number that was bound to.
.PP
The
.BR iruserok ()