1 .\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI
9 .Nd bind a socket to a privileged IP port
14 .Fn bindresvport "int sd" "struct sockaddr_in *sin"
16 .Fn bindresvport_sa "int sd" "struct sockaddr *sa"
23 are used to bind a socket descriptor to a privileged
26 port number in the range 0-1023.
31 .Ft "struct sockaddr_in"
32 then the appropriate fields in the structure should be defined.
35 must be initialized to the address family of the socket, passed by
41 then an anonymous port (in the range 600-1023) will be
46 will be updated to contain the allocated port.
53 an anonymous port will be allocated (as above).
54 However, there is no way for
56 to return the allocated port in this case.
58 Only root can bind to a privileged port; this call will fail for any
69 acts exactly the same, with more neutral function prototype.
70 Note that both functions behave exactly the same, and
80 .It Bq Er EPFNOSUPPORT
81 If second argument was supplied,
82 and address family did not match between arguments.
90 for any of the errors specified for the calls
98 function is part of libtirpc.