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
16 .Fn bindresvport "int sd" "struct sockaddr_in *sin"
18 .Fn bindresvport_sa "int sd" "struct sockaddr *sa"
25 are used to bind a socket descriptor to a privileged
28 port number in the range 0-1023.
33 .Ft "struct sockaddr_in"
34 then the appropriate fields in the structure should be defined.
37 must be initialized to the address family of the socket, passed by
43 then an anonymous port (in the range 600-1023) will be
48 will be updated to contain the allocated port.
55 an anonymous port will be allocated (as above).
56 However, there is no way for
58 to return the allocated port in this case.
60 Only root can bind to a privileged port; this call will fail for any
71 acts exactly the same, with more neutral function prototype.
72 Note that both functions behave exactly the same, and
82 .It Bq Er EPFNOSUPPORT
83 If second argument was supplied,
84 and address family did not match between arguments.
92 for any of the errors specified for the calls