Manpages - bindresvport.3t
The
and
functions are used to bind a socket descriptor to a privileged
port, that is, a port number in the range 0-1023.
If
is a pointer to a
then the appropriate fields in the structure should be defined. Note that
must be initialized to the address family of the socket, passed by
If
is
then an anonymous port (in the range 600-1023) will be chosen, and if
is successful, the
will be updated to contain the allocated port.
If
is the
pointer, an anonymous port will be allocated (as above). However, there is no way for
to return the allocated port in this case.
Only root can bind to a privileged port; this call will fail for any other users.
Function prototype of
is biased to
socket. The
function acts exactly the same, with more neutral function prototype. Note that both functions behave exactly the same, and both support
sockets as well as
sockets.
If second argument was supplied, and address family did not match between arguments.
The
function may also fail and set
for any of the errors specified for the calls
or
The
function is part of libtirpc.