NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
#include <sys/types.h> #include <sys/socket.h>int getsockname(int s, struct sockaddr *name, int *namelen);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
POSIX_SOCKETS
The getsockname function returns the current name for the specified socket. The namelen parameter should be initialized to indicate the amount of space pointed to by name. On return it contains the actual size of the name returned (in bytes).
Upon successful completion, getsockname returns 0; otherwise it returns -1 and sets errno to indicate one of the following error conditions:
The s argument is not a valid descriptor.
The name argument, or the namelen argument is invalid.
The s argument is a file, not a socket.
Insufficient resources were available within the system to perform the operation.
Returns after a socket shutdown.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
MT-level | MT-safe |
NAME | SYNOPSIS | API RESTRICTIONS | FEATURES | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO