Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 8

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 );

Arguments:

sd
The socket descriptor to bind to the port.
sin
A pointer to a sockaddr_in structure that specifies the privileged IP port.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The bindresvport() function binds a socket descriptor to a privileged IP port (i.e. a port number in the range 0-1023).


Note: Only root can bind to a privileged port; this call fails for any other user.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EACCES
You must be root to call bindresvport().
EADDRINUSE
The specified address is already in use.
EADDRNOTAVAIL
The specified address isn't available from the local machine.
EBADF
Invalid descriptor sd.
EFAULT
The sin parameter isn't a valid pointer to a sockaddr_in structure.
EINVAL
The socket is already bound to a port.
EPFNOSUPPORT
The protocol family isn't supported.

Classification:

Unix

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread No

See also:

connect(), getsockname(), listen(), socket()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 184

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/b/bindresvport.html on line 184