.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\" @(#)getpeername.2 6.2 (Berkeley) %G%
getpeername \- get name of connected peer
getpeername(s, name, namelen)
returns the name of the peer connected to
parameter should be initialized to indicate
the amount of space pointed to by
On return it contains the actual size of the name
The name is truncated if the buffer provided is too small.
A 0 is returned if the call succeeds, \-1 if it fails.
The call succeeds unless:
The argument \fIs\fP is not a valid descriptor.
The argument \fIs\fP is a file, not a socket.
The socket is not connected.
Insufficient resources were available in the system
to perform the operation.
parameter points to memory not in a valid part of the
accept(2), bind(2), socket(2), getsockname(2)