SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from PCLinuxOS lib64tirpc-devel-1.0.1-1pclos2017.x86_64.rpm

BINDRESVPORT

Section: C Library Functions (3)
Index
BSD mandoc
 

NAME

bindresvport bindresvport_sa - bind a socket to a privileged IP port 

SYNOPSIS

In sys/types.hIn rpc/rpc.hFt intFn bindresvport int sd struct sockaddr_in *sinFt intFn bindresvport_sa int sd struct sockaddr *sa 

DESCRIPTION

TheFn bindresvportandFn bindresvport_safunctionsare used to bind a socket descriptor to a privilegedIPport, that is, aport number in the range 0-1023.

IfFa sinis a pointer to aFt struct sockaddr_inthen the appropriate fields in the structure should be defined.Note thatFa sin->sin_familymust be initialized to the address family of the socket, passed byFa sd .IfFa sin->sin_portis`0'then an anonymous port (in the range 600-1023) will bechosen, and ifbind(2)is successful, theFa sin->sin_portwill be updated to contain the allocated port.

IfFa sinis theNULLpointer,an anonymous port will be allocated (as above).However, there is no way forFn bindresvportto return the allocated port in this case.

Only root can bind to a privileged port; this call will fail for anyother users.

Function prototype ofFn bindresvportis biased toAF_INETsocket.TheFn bindresvport_safunctionacts exactly the same, with more neutral function prototype.Note that both functions behave exactly the same, andboth supportAF_INET6sockets as well asAF_INETsockets. 

RETURN VALUES

Rv -std bindresvport 

ERRORS

Bq Er EPFNOSUPPORT
If second argument was supplied,and address family did not match between arguments.

TheFn bindresvportfunctionmay also fail and seterrnofor any of the errors specified for the callsbind(2),getsockopt(2),orsetsockopt(2). 

AVAILABILITY

TheFn bindresvportfunction is part of libtirpc. 

SEE ALSO

bind(2),getsockopt(2),setsockopt(2)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
AVAILABILITY
SEE ALSO

This document was created byman2html,using the manual pages.