version 1.7, 1999/12/11 10:05:04 |
version 1.8, 2003/03/13 15:47:10 |
|
|
|
|
/* have network connection; identify the host connected with */ |
/* have network connection; identify the host connected with */ |
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), |
if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), |
NULL, 0, NI_NUMERICHOST) != 0) { |
NULL, 0, NI_NUMERICHOST) != 0) { |
strcpy(hbuf, "(invalid)"); |
strlcpy(hbuf, "(invalid)", sizeof hbuf); |
} |
} |
(void)printf("[%s/%s]\n", host, hbuf); |
(void)printf("[%s/%s]\n", host, hbuf); |
|
|