get the name of a socket
#include <sys/socket.h> int getsockname( int s, struct sockaddr *name, int *namelen );
The getsockname() function returns the current name for the specified socket. The namelen parameter should indicate the amount of space pointed to by name. On return, namelen contains the actual size of the name (in bytes).
If an error occurred, errno could contain one of the following:
POSIX 1003.1g (draft)
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |