Bug 52741

Summary: getnameinfo man page has inappropriate text copied from getaddrinfo
Product: Documentation Reporter: Peter Budny (bigpeteb)
Component: man-pagesAssignee: documentation_man-pages (documentation_man-pages)
Status: RESOLVED CODE_FIX    
Severity: normal CC: mtk.manpages
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description Peter Budny 2013-01-15 14:50:30 UTC
As of release 3.43 on 2012-08-05, the man page for getnameinfo(3) contains the following in its first paragraph:

"It combines the functionality of gethostbyaddr(3) and getservbyport(3),  but  unlike those functions, getaddrinfo(3) is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies."

This text is identical to what's in getaddrinfo(3).  It seems someone copied it but didn't rewrite it to describe the functions that getnameinfo(3) is intended to replace.
Comment 1 Michael Kerrisk 2013-01-15 19:46:01 UTC
Thkanks for the report Peter.

So, it seems here were a confused references in both getnameinfo() and getaddrinfo(). I applied the following patch.

--- a/man3/getaddrinfo.3
+++ b/man3/getaddrinfo.3
@@ -91,7 +91,7 @@ function combines the functionality provided by the
 .\" .BR getipnodebyaddr (3),
 .BR getservbyname (3)
 and
-.BR getservbyport (3)
+.BR getservbyname (3)
 functions into a single interface, but unlike the latter functions,
 .BR getaddrinfo ()
 is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies.
diff --git a/man3/getnameinfo.3 b/man3/getnameinfo.3
index f1001cd..5bafd76 100644
--- a/man3/getnameinfo.3
+++ b/man3/getnameinfo.3
@@ -38,7 +38,7 @@ It combines the functionality of
 and
 .BR getservbyport (3),
 but unlike those functions,
-.BR getaddrinfo (3)
+.BR getnameinfo (3)
 is reentrant and allows programs to eliminate
 IPv4-versus-IPv6 dependencies.
 
@@ -111,7 +111,7 @@ cannot be determined.)
 If set, then the numeric form of the service address is returned.
 (When not set, this will still happen in case the service's name
 cannot be determined.)
-.SS "Extensions to getaddrinfo() for Internationalized Domain Names"
+.SS "Extensions to getnameinfo() for Internationalized Domain Names"
 .PP
 Starting with glibc 2.3.4,
 .BR getnameinfo ()