]> git.saurik.com Git - apple/libinfo.git/blob - rpc.subproj/bindresvport.3
Libinfo-278.tar.gz
[apple/libinfo.git] / rpc.subproj / bindresvport.3
1 .\" from: @(#)bindresvport.3n 2.2 88/08/02 4.0 RPCSRC; from 1.7 88/03/14 SMI
2 .\" $Id: bindresvport.3,v 1.1 1999/04/13 23:15:36 wsanchez Exp $
3 .\"
4 .Dd November 22, 1987
5 .Dt BINDRESVPORT 3
6 .Os
7 .Sh NAME
8 .Nm bindresvport
9 .Nd bind a socket to a privileged IP port
10 .Sh SYNOPSIS
11 .Fd #include <sys/types.h>
12 .Fd include <netinet/in.h>
13 .Ft int
14 .Fn bindresvport "int sd" "struct sockaddr_in **sin"
15 .Sh DESCRIPTION
16 .Fn bindresvport
17 is used to bind a socket descriptor to a privileged
18 .Tn 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 .Va errno
24 set to reflect the cause of the error.
25 .Pp
26 Only root can bind to a privileged port; this call will fail for any
27 other users.