Deleted Added
sdiff udiff text old ( 56629 ) new ( 56660 )
full compact
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 $
3.\"
4.Dd November 22, 1987
5.Dt BINDRESVPORT 3
6.Os
7.Sh NAME
8.Nm bindresvport ,
9.Nm bindresvport_sa ,
10.Ndbind a socket to a privileged IP port
11.Sh SYNOPSIS
12.Fd #include <sys/types.h>
13.Fd #include <netinet/in.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
19.Nm Bindresvport
20and
21.Nm 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
62returns 0 if it is successful, otherwise \-1 is returned and
63.Va errno
64set to reflect the cause of the error.
65.Sh ERRORS
66The
67.Fn bindresvport
68function fails 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 ---