getsockname - get socket name
#include <sys/types.h>
#include <sys/socket.h>
getsockname() returns the current name for socket s. The namelen parameter should be initialized to indicate the amount of space pointed to by name . On return it contains the actual size in bytes of the name returned.
If successful, getsockname() returns 0; otherwise it returns -1 and sets errno to indicate the error.
This function is a member of Unison's IOLIB family of functions. IOLIB is implemented as a message passing and generalized interface layer. Each Unison I/O server is responsible for its own error reporting.
For an exact list of error codes returned by a particular server, refer to that server's documentation in the Unison Programmer's Guide for each specific platform.
Servers may implement these errors codes in response to this function.
The call succeeds unless:
accept(), bind(), getpeername(), socket()