Rgetsockname()

Get the name of a socket (via a SOCKS server)

Synopsis:

#include <sys/socket.h>

int Rgetsockname( int s, 
                  struct sockaddr * name, 
                  int * namelen );

Arguments:

s
The file descriptor of the socket whose name you want to get.
name
A pointer to a sockaddr object where the function can store the socket's name.
namelen
A pointer to a socklen_t object that initially indicates the amount of space pointed to by name. The function updates namelen to contain the actual size of the name (in bytes).

Library:

libsocks

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

Description:

The Rgetsockname() function is a cover function for getsockname()—the difference is that Rgetsockname() does its job via a SOCKS server.

For more information about SOCKS and its libraries, see the appendix, SOCKS—A Basic Firewall.

Returns:

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

Classification:

SOCKS

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