]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/bindresvport.3
ffix
[thirdparty/man-pages.git] / man3 / bindresvport.3
1 .\" This page was taken from the 4.4BSD-Lite CDROM (BSD license)
2 .\"
3 .\" @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI
4 .TH BINDRESVPORT 3 1987-11-22
5 .SH NAME
6 bindresvport \- bind a socket to a privileged IP port
7 .SH SYNOPSIS
8 .nf
9 .B #include <sys/types.h>
10 .B #include <netinet/in.h>
11 .LP
12 .BI "int bindresvport(int " sd ", struct sockaddr_in **" sin );
13 .fi
14 .SH DESCRIPTION
15 .LP
16 .BR bindresvport ()
17 is used to bind a socket descriptor to a privileged
18 .SM IP
19 port, that is, a
20 port number in the range 0-1023.
21 The routine returns 0 if it is successful,
22 otherwise \-1 is returned and
23 .I errno
24 set to reflect the cause of the error.
25 .LP
26 Only root can bind to a privileged port; this call will fail for any
27 other users.