getpeername - get name of connected peer returns the name of the peer connected to socket The parameter should be initialized to indicate the amount of space pointed to by On return it contains the actual size of the name returned (in bytes). The name is truncated if the buffer provided is too small. On success, zero is returned. On error, -1 is returned, and is set appropriately. The argument is not a valid descriptor. The argument is a file, not a socket. The socket is not connected. Insufficient resources were available in the system to perform the operation. The parameter points to memory not in a valid part of the process address space.

HISTORY
The function call appeared in BSD 4.2.