bindresvport.3 (5a489ac2b83144b08b8f4cbefdf60f397a6aa412) bindresvport.3 (639460dc29f84085e711dcf1463b179db5a50f87)
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.TH BINDRESVPORT 3 "22 november 1987"
3.SH NAME
4bindresvport \- bind a socket to a privileged IP port
5.SH SYNOPSIS
6.nf
7.B #include <sys/types.h>
8.B #include <netinet/in.h>
9.LP
10.B int bindresvport(sd, sin)
11.B int sd;
12.B struct sockaddr_in \(**sin;
13.fi
14.SH DESCRIPTION
15.LP
16.B bindresvport(\|)
2.Dd "22 november 1987"
3.Dt BINDRESVPORT 3
4.Os
5.Sh NAME
6.Nm bindresvport
7.Ndbind a socket to a privileged IP port
8.Sh SYNOPSIS
9.Fd #include <sys/types.h>
10.Fd #include <netinet/in.h>
11.Ft int
12.Fn bindresvport "int sd "struct sockaddr_in **sin"
13.Sh DESCRIPTION
14.Nm Bindresvport
17is used to bind a socket descriptor to a privileged
15is used to bind a socket descriptor to a privileged
18.SM IP
16.Em IP
19port, that is, a
20port number in the range 0-1023.
21The routine returns 0 if it is successful,
17port, that is, a
18port number in the range 0-1023.
19The routine returns 0 if it is successful,
22otherwise \-1 is returned and
23.B errno
20otherwise -1 is returned and
21.Va errno
24set to reflect the cause of the error.
22set to reflect the cause of the error.
25.LP
23.Pp
26Only root can bind to a privileged port; this call will fail for any
27other users.
24Only root can bind to a privileged port; this call will fail for any
25other users.