SYNOPSIS
#include <sys/socket.h>
int getpeername(int s, struct sockaddr *name, socklen_t *namelen);
DESCRIPTION
The
Upon return, the namelen parameter contains the actual size of the name returned in bytes.
PARAMETERS
- s
-
Is a descriptor that identifies a connected socket.
- name
-
Points to the structure that is to receive the name of the peer.
- namelen
-
Indicates, initially, the amount of space pointed to by name. Upon return, it contains the actual size, in bytes, of the returned name.
RETURN VALUES
If successful,
- EFAULT
-
name is an invalid pointer or namelen parameter is not large enough.
- ENETDOWN
-
The network subsystem failed.
- ENOTCONN
-
The socket is not connected.
- ENOTSOCK
-
The descriptor is not a socket.
- EBADF
-
s is not a valid descriptor.
CONFORMANCE
UNIX 98.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
accept() ,bind() ,getsockname() ,socket()
PTC MKS Toolkit 10.5 Documentation Build 40.