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 $
4 .\" $DragonFly: src/lib/libc/rpc/bindresvport.3,v 1.3 2007/08/18 20:48:47 swildner Exp $
12 .Nd bind a socket to a privileged IP port
19 .Fn bindresvport "int sd" "struct sockaddr_in *sin"
21 .Fn bindresvport_sa "int sd" "struct sockaddr *sa"
28 are used to bind a socket descriptor to a privileged
31 port number in the range 0-1023.
36 .Ft "struct sockaddr_in"
37 then the appropriate fields in the structure should be defined.
40 must be initialized to the address family of the socket, passed by
46 then an anonymous port (in the range 600-1023) will be
51 will be updated to contain the allocated port.
58 an anonymous port will be allocated (as above).
59 However, there is no way for
61 to return the allocated port in this case.
63 Only root can bind to a privileged port; this call will fail for any
74 acts exactly the same, with more neutral function prototype.
75 Note that both functions behave exactly the same, and
85 .It Bq Er EPFNOSUPPORT
86 If second argument was supplied,
87 and address family did not match between arguments.
95 for any of the errors specified for the calls