mirror of https://github.com/mkerrisk/man-pages
getifaddrs.3: Various small fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
8aa7b8ebca
commit
d664f7cecf
|
@ -160,6 +160,8 @@ The
|
|||
function first appeared in glibc 2.3, but before glibc 2.3.3,
|
||||
the implementation only supported IPv4 addresses;
|
||||
IPv6 support was added in glibc 2.3.3.
|
||||
Support of address families other than IPv4 is only available
|
||||
on kernels that support netlink.
|
||||
.SH CONFORMING TO
|
||||
Not in POSIX.1-2001.
|
||||
This function first appeared in BSDi and is
|
||||
|
@ -198,7 +200,7 @@ The program below demonstrates the use of
|
|||
.BR getifaddrs (),
|
||||
.BR freeifaddrs (),
|
||||
and
|
||||
.BR inet_ntop (3).
|
||||
.BR getnameinfo (3).
|
||||
Here is what we see when running this program on one system:
|
||||
.in +4n
|
||||
.nf
|
||||
|
@ -231,7 +233,6 @@ int
|
|||
main(int argc, char *argv[])
|
||||
{
|
||||
struct ifaddrs *ifaddr, *ifa;
|
||||
struct net_device_stats *ndsp;
|
||||
int family, s;
|
||||
char host[NI_MAXHOST];
|
||||
|
||||
|
@ -249,7 +250,7 @@ main(int argc, char *argv[])
|
|||
/* Display interface name and family (including symbolic
|
||||
form of the latter for the common families) */
|
||||
|
||||
printf("%\-6s address family: %d%s\\n",
|
||||
printf("%s\t address family: %d%s\\n",
|
||||
ifa\->ifa_name, family,
|
||||
(family == AF_PACKET) ? " (AF_PACKET)" :
|
||||
(family == AF_INET) ? " (AF_INET)" :
|
||||
|
|
Loading…
Reference in New Issue