1 .\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI
2 .\" $NetBSD: bindresvport.3,v 1.8 2000/07/05 15:45:33 msaitoh Exp $
3 .\" $FreeBSD: src/lib/libc/rpc/bindresvport.3,v 1.15 2002/12/18 12:45:10 ru Exp $
11 .Nd bind a socket to a privileged IP port
18 .Fn bindresvport "int sd" "struct sockaddr_in *sin"
20 .Fn bindresvport_sa "int sd" "struct sockaddr *sa"
27 are used to bind a socket descriptor to a privileged
30 port number in the range 0-1023.
35 .Ft "struct sockaddr_in"
36 then the appropriate fields in the structure should be defined.
39 must be initialized to the address family of the socket, passed by
45 then an anonymous port (in the range 600-1023) will be
50 will be updated to contain the allocated port.
57 an anonymous port will be allocated (as above).
58 However, there is no way for
60 to return the allocated port in this case.
62 Only root can bind to a privileged port; this call will fail for any
73 acts exactly the same, with more neutral function prototype.
74 Note that both functions behave exactly the same, and
84 .It Bq Er EPFNOSUPPORT
85 If second argument was supplied,
86 and address family did not match between arguments.
94 for any of the errors specified for the calls