bindresvport.3 (84306) | bindresvport.3 (108037) |
---|---|
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 $ | 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: head/lib/libc/rpc/bindresvport.3 84306 2001-10-01 16:09:29Z ru $ | 3.\" $FreeBSD: head/lib/libc/rpc/bindresvport.3 108037 2002-12-18 12:45:11Z ru $ |
4.\" 5.Dd November 22, 1987 6.Dt BINDRESVPORT 3 7.Os 8.Sh NAME 9.Nm bindresvport , 10.Nm bindresvport_sa 11.Nd bind a socket to a privileged IP port 12.Sh LIBRARY 13.Lb libc 14.Sh SYNOPSIS 15.In sys/types.h 16.In rpc/rpc.h 17.Ft int 18.Fn bindresvport "int sd" "struct sockaddr_in *sin" 19.Ft int 20.Fn bindresvport_sa "int sd" "struct sockaddr *sa" 21.Sh DESCRIPTION | 4.\" 5.Dd November 22, 1987 6.Dt BINDRESVPORT 3 7.Os 8.Sh NAME 9.Nm bindresvport , 10.Nm bindresvport_sa 11.Nd bind a socket to a privileged IP port 12.Sh LIBRARY 13.Lb libc 14.Sh SYNOPSIS 15.In sys/types.h 16.In rpc/rpc.h 17.Ft int 18.Fn bindresvport "int sd" "struct sockaddr_in *sin" 19.Ft int 20.Fn bindresvport_sa "int sd" "struct sockaddr *sa" 21.Sh DESCRIPTION |
22The |
|
22.Fn bindresvport 23and 24.Fn bindresvport_sa | 23.Fn bindresvport 24and 25.Fn bindresvport_sa |
26functions |
|
25are used to bind a socket descriptor to a privileged 26.Tn IP 27port, that is, a 28port number in the range 0-1023. 29.Pp 30If 31.Fa sin 32is a pointer to a --- 27 unchanged lines hidden (view full) --- 60Only root can bind to a privileged port; this call will fail for any 61other users. 62.Pp 63Function prototype of 64.Fn bindresvport 65is biased to 66.Dv AF_INET 67socket. | 27are used to bind a socket descriptor to a privileged 28.Tn IP 29port, that is, a 30port number in the range 0-1023. 31.Pp 32If 33.Fa sin 34is a pointer to a --- 27 unchanged lines hidden (view full) --- 62Only root can bind to a privileged port; this call will fail for any 63other users. 64.Pp 65Function prototype of 66.Fn bindresvport 67is biased to 68.Dv AF_INET 69socket. |
70The |
|
68.Fn bindresvport_sa | 71.Fn bindresvport_sa |
72function |
|
69acts exactly the same, with more neutral function prototype. 70Note that both functions behave exactly the same, and 71both support 72.Dv AF_INET6 73sockets as well as 74.Dv AF_INET 75sockets. 76.Sh RETURN VALUES 77.Rv -std bindresvport 78.Sh ERRORS 79.Bl -tag -width Er 80.It Bq Er EPFNOSUPPORT 81If second argument was supplied, 82and address family did not match between arguments. 83.El 84.Pp | 73acts exactly the same, with more neutral function prototype. 74Note that both functions behave exactly the same, and 75both support 76.Dv AF_INET6 77sockets as well as 78.Dv AF_INET 79sockets. 80.Sh RETURN VALUES 81.Rv -std bindresvport 82.Sh ERRORS 83.Bl -tag -width Er 84.It Bq Er EPFNOSUPPORT 85If second argument was supplied, 86and address family did not match between arguments. 87.El 88.Pp |
89The |
|
85.Fn bindresvport | 90.Fn bindresvport |
91function |
|
86may also fail and set 87.Va errno 88for any of the errors specified for the calls 89.Xr bind 2 , 90.Xr getsockopt 2 , 91or 92.Xr setsockopt 2 . 93.Sh SEE ALSO 94.Xr bind 2 , 95.Xr getsockopt 2 , 96.Xr setsockopt 2 , 97.Xr ip 4 | 92may also fail and set 93.Va errno 94for any of the errors specified for the calls 95.Xr bind 2 , 96.Xr getsockopt 2 , 97or 98.Xr setsockopt 2 . 99.Sh SEE ALSO 100.Xr bind 2 , 101.Xr getsockopt 2 , 102.Xr setsockopt 2 , 103.Xr ip 4 |