NAME

getsockname - get socket name

SYNOPSIS

#include <sys/types.h>
#include <sys/socket.h>

int getsockname(int s , struct sockaddr *name , socklen_t *namelen );

DESCRIPTION

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.

RETURN VALUES

If successful, getsockname() returns 0; otherwise it returns -1 and sets errno to indicate the error.

ERRORS

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:

EBADF
The argument s is not a valid file descriptor.
ENOMEM
There was insufficient memory available for the operation to complete.
ENOTSOCK
The argument s is not a socket.

SEE ALSO

accept(), bind(), getpeername(), socket()



< Copyright Rowebots Research Inc. and Multiprocessor Toolsmiths Inc. 1987-2011 >