2 getpeername - get name of connected peer
7 int getpeername(int s, struct sockaddr *name, socklen_t
11 Getpeername returns the name of the peer connected to
12 socket s. The namelen parameter should be initialized to
13 indicate the amount of space pointed to by name. On
14 return it contains the actual size of the name returned
15 (in bytes). The name is truncated if the buffer provided
19 On success, zero is returned. On error, -1 is returned,
20 and errno is set appropriately.
23 EBADF The argument s is not a valid descriptor.
26 The argument s is a file, not a socket.
29 The socket is not connected.
31 ENOBUFS Insufficient resources were available in the sys-
32 tem to perform the operation.