are used to bind a socket descriptor to a privileged
port, that is, a
port number in the range 0-1023.
is a pointer to a
then the appropriate fields in the structure should be defined.
must be initialized to the address family of the socket, passed by
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.
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
Function prototype of
is biased to
acts exactly the same, with more neutral function prototype.
Note that both functions behave exactly the same, and
sockets as well as