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/r/rresvport.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/r/rresvport.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/r/rresvport.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/r/rresvport.html on line 8

rresvport(), rresvport_af()

Obtain a socket with a privileged address

Synopsis:

#include <unistd.h>

int rresvport( int * port );

int rresvport_af( int * port,
                  int af );

Arguments:

port
An address in the privileged port space. Privileged Internet ports are those in the range 0 to 1023. Only the superuser may bind this type of address to a socket.
af
(rresvport_af() only) The address family; see <sys/socket.h>.

Library:

libsocket

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

Description:

The rresvport() function returns a descriptor to a socket with an address in the privileged port space. The rresvport_af() function is similar, but you can use it for address families other than AF_INET.

The ruserok() function is used by servers to authenticate clients requesting service with rcmd(). All three functions are present in the same file and are used by the rshd server (see the Utilities Reference), among others.

The rresvport() and rresvport_af() functions obtain a socket with a privileged address bound to it. This socket can be used by rcmd() and several other functions.

Returns:

A valid, bound socket descriptor, or -1 if an error occurs (errno is set).

Errors:

The error code EAGAIN is overloaded to mean “All network ports in use.”

Classification:

Unix

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

See also:

iruserok(), iruserok_sa(), rcmd(), ruserok()

rshd in the Utilities Reference


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/r/rresvport.html on line 151

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/r/rresvport.html on line 151