This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Obtain a socket with a privileged address
#include <unistd.h> int rresvport( int * port );
libsocket
Use the -l socket option to qcc to link against this library.
The rresvport() function returns a descriptor to a socket with an address in the privileged port space. 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() function obtains a socket with a privileged address bound to it. This socket can be used by rcmd() and several other functions.
A valid, bound socket descriptor, or -1 if an error occurs (errno is set).
The error code EAGAIN is overloaded to mean "All network ports in use."
Safety: | |
---|---|
Cancellation point | Yes |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
rshd in the Utilities Reference