GETPEERNAME(2) Series 300 Only GETPEERNAME(2)
NAME
getpeername - get address of connected peer
SYNOPSIS
getpeername(s, addr, addrlen)
int s;
struct sockaddr *addr;
int *addrlen;
HP-UX COMPATIBILITY
Level: HP-UX/NON-STANDARD
Origin: UCB
Remarks: Implemented on the Series 300 only.
DESCRIPTION
S is a socket descriptor. Getpeername returns the address
of the peer socket connected to the socket indicated by s.
Addr points to a socket address structure in which this
address is returned. The addrlen parameter points to an
object of the type int which should be initialized to
indicate the size of the address structure. On return it
contains the actual size of the address returned (in bytes).
If addr does not point to enough space to contain the whole
address of the peer, only the first addrlen bytes of the
address will be returned.
The getpeername call fails if:
[EBADF] The argument s is not a valid descriptor.
[ENOTSOCK] The argument s is a file, not a socket.
[ENOTCONN] The socket is not connected.
[ENOBUFS] Insufficient resources were available in the
system to perform the operation.
[EFAULT] The addr or addrlen parameters are not valid
pointers.
[EINVAL] The socket has been shut down.
[ENET] A hardware error is detected on the interface
card.
RETURN VALUE
A 0 is returned if the call succeeds; -1 if it fails.
SEE ALSO
bind(2), socket(2), getsockname(2), inet(4F).
Hewlett-Packard - 1 - (printed 7/16/86)