bindresvport.3 (56629) | bindresvport.3 (56660) |
---|---|
1.\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI | 1.\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI |
2.\" $FreeBSD: head/lib/libc/rpc/bindresvport.3 56629 2000-01-26 09:02:42Z shin $ | 2.\" $FreeBSD: head/lib/libc/rpc/bindresvport.3 56660 2000-01-27 02:55:01Z bde $ |
3.\" | 3.\" |
4.Dd November 22, 1987 | 4.Dd January 27, 2000 |
5.Dt BINDRESVPORT 3 6.Os 7.Sh NAME 8.Nm bindresvport , | 5.Dt BINDRESVPORT 3 6.Os 7.Sh NAME 8.Nm bindresvport , |
9.Nm bindresvport_sa , | 9.Nm bindresvport_sa |
10.Ndbind a socket to a privileged IP port 11.Sh SYNOPSIS | 10.Ndbind a socket to a privileged IP port 11.Sh SYNOPSIS |
12.Fd #include <sys/types.h> 13.Fd #include <netinet/in.h> | 12.Fd #include <rpc/rpc.h> |
14.Ft int 15.Fn bindresvport "int sd" "struct sockaddr_in *sin" 16.Ft int 17.Fn bindresvport_sa "int sd" "struct sockaddr *sa" 18.Sh DESCRIPTION | 13.Ft int 14.Fn bindresvport "int sd" "struct sockaddr_in *sin" 15.Ft int 16.Fn bindresvport_sa "int sd" "struct sockaddr *sa" 17.Sh DESCRIPTION |
19.Nm Bindresvport | 18.Fn bindresvport |
20and | 19and |
21.Nm Bindresvport_sa | 20.Fn bindresvport_sa |
22are used to bind a socket descriptor to a privileged 23.Tn IP 24port, that is, a 25port number in the range 0-1023. 26.Pp 27Only root can bind to a privileged port; this call will fail for any 28other users. 29.Pp --- 24 unchanged lines hidden (view full) --- 54Note that both functions behave exactly the same, and 55both support 56.Dv AF_INET6 57sockets as well as 58.Dv AF_INET 59sockets. 60.Sh RETURN VALUES 61.Fn bindresvport | 21are used to bind a socket descriptor to a privileged 22.Tn IP 23port, that is, a 24port number in the range 0-1023. 25.Pp 26Only root can bind to a privileged port; this call will fail for any 27other users. 28.Pp --- 24 unchanged lines hidden (view full) --- 53Note that both functions behave exactly the same, and 54both support 55.Dv AF_INET6 56sockets as well as 57.Dv AF_INET 58sockets. 59.Sh RETURN VALUES 60.Fn bindresvport |
62returns 0 if it is successful, otherwise \-1 is returned and | 61and 62.Fn bindresvport_sa 63return 0 if they are successful, otherwise \-1 is returned and |
63.Va errno 64set to reflect the cause of the error. 65.Sh ERRORS 66The 67.Fn bindresvport | 64.Va errno 65set to reflect the cause of the error. 66.Sh ERRORS 67The 68.Fn bindresvport |
68function fails if: | 69and 70.Fn bindresvport_sa 71functions fail if: |
69.Bl -tag -width Er 70.It Bq Er EBADF 71.Fa sd 72is not a valid descriptor. 73.It Bq Er ENOTSOCK 74.Fa sd 75is not a socket. 76.It Bq Er EADDRNOTAVAIL --- 27 unchanged lines hidden --- | 72.Bl -tag -width Er 73.It Bq Er EBADF 74.Fa sd 75is not a valid descriptor. 76.It Bq Er ENOTSOCK 77.Fa sd 78is not a socket. 79.It Bq Er EADDRNOTAVAIL --- 27 unchanged lines hidden --- |