Bug 128370 - Wrong function prototype for gethostbyaddr
Wrong function prototype for gethostbyaddr
Product: Fedora
Classification: Fedora
Component: man-pages (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eido Inoue
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2004-07-22 05:19 EDT by Mikael Lindberg
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-20 14:08:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mikael Lindberg 2004-07-22 05:19:37 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030625

Description of problem:
The man page gethostbyaddr(3) specifies the function prototype to be

struct hostent *gethostbyaddr(const *char, int, int) 

while it should be 

struct hostent *gethostbyaddr(const *void, socklen_t, int)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
man 3 gethostbyaddr

Additional info:

/usr/include/netdb.h  specifies the prototype as

extern struct hostent *gethostbyaddr (__const void *__addr,
__socklen_t __len, int __type) __THROW;
Comment 1 Mikael Lindberg 2004-07-22 16:00:58 EDT
I could create a patch, but the change is so small I don't know if
it's of any use. :)

Also, the man-page could use some fleshing out (the arguments to the
function in question could be explained a bit better), but as this is
my first ever contribution to an OSS project, I'd be happy if somebody
could tell me if such a contribution would be welcomed.
Comment 2 Mikael Lindberg 2004-07-28 07:26:53 EDT
Mailed Andries Brouwer (the maintainer of the man-pages) and he
corrected it. Also, he mentioned that the BSD prototype specifies char*. 
What is correct in this case?
Comment 3 Eido Inoue 2004-08-20 14:08:39 EDT
The man-page specifically mentions that the prototypes conform to BSD.
It also mentions that socklen_t is the correct type for POSIX in the

man 3p gethostbyname

should be used to refer to the POSIX man pages.

Note You need to log in before you can comment on or make changes to this bug.