First page Back Continue Last page Overview Graphics
getnameinfo()
int getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *host, socklen_t hostlen,
char *serv, socklen_t servlen,
int flags);
#define NI_MAXHOST 1025
#define NI_MAXSERV 32
Address-to-name translation function
Extract node name, service name from socket address structure and put in human readable format
Not an address structure but a socket address structure
- support scope architecture
- e.g. “ff02::1%link0”, “fec0::1%site0”
MT-Safe
NI_MAXHOST, NI_MAXSERV: size enough for host, serv
Notes: