Linux Man Pages

Unix Manual Pages Home

Free Linux Documentation

Manual pages sections
Almost all UNIX operating systems have voluminous documentation known as manual pages. Every page is a document. If one wants to read a page then the command man at a shell prompt will show the manual, for example, "man ftp". Pages are referred by using the notation "name(manual-section)", for example time(1).


Man Page :: Unix Man Pages - bindresvport
Browse Linux man pages by name. Choose the first letter of the name of the Linux command, function, or file you are interested in:
a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|_| All


NAME

bindresvport - bind a socket to a privileged IP port

SYNOPSIS


#include <sys/types.h> #include <netinet/in.h>
int bindresvport(int sd , struct sockaddr_in ** sin );

DESCRIPTION

bindresvport () is used to bind a socket descriptor to a privileged IP port, that is, a port number in the range 0-1023.

If in->sin_port is 0 then an anonymous port in the range 600 to 1023 be chosen. If the bind (2) performed by bindresvport () is successful, then sin->sin_port returns the port number actually allocated.

sin can be NULL, in which case sin->sin_family is implicitly taken to be AF_INET and an anonymous port is allocated (as above). However, in this case, bindresvport () has no way to return the port number actually allocated.

RETURN VALUE

bindresvport () returns 0 if it is successful, otherwise -1 is returned and errno set to indicate the cause of the error.

ERRORS

bindresvport () can fail for any of the same reasons as bind (2).

CONFORMING TO

Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other systems.

NOTES

Only root can bind to a privileged port; this call will fail for any other users. In addition, the following error may occur:

EPFNOSUPPORT sin is not NULL and sin->sin_family is not AF_INET .

SEE ALSO

bind (2)



Unix / Linux Man Pages
Copyright (C) 2008 istild.com. All Rights Reserved.

Unix / Linux Manual Pages Man Pages Man Pages Online Documentation - Valid CSS!