inet_ntop(3) Library Functions Manual inet_ntop(3) inet_ntop - IPv4 IPv6 LIBRARY Standard C library (libc, -lc) #include const char *inet_ntop(int af, const void *restrict src, char dst[restrict .size], socklen_t size); src af dst, NULL. size . inet_ntoa(3) inet_ntop() , inet_ntoa(3). : AF_INET src struct in_addr ( ), IPv4 - <>. dst , , INET_ADDRSTRLEN . AF_INET6 src struct in6_addr ( ), IPv6 . dst , , INET6_ADDRSTRLEN . inet_ntop() -NULL dst. NULL, errno . EAFNOSUPPORT af . ENOSPC , size. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |inet_ntop() | | MT-Safe locale | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. Note that RFC 2553 defines a prototype where the last argument size is of type size_t. Many systems follow RFC 2553. glibc 2.0 and 2.1 have size_t, but 2.2 and later have socklen_t. AF_INET6 IPv4- IPv6 IPv6. inet_pton(3). . getnameinfo(3), inet(3), inet_pton(3) Azamat Hackimov , Dmitriy S. Seregin , Yuri Kozlov ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . inet_ntop(3)