Bug 128370 - Wrong function prototype for gethostbyaddr
Summary: Wrong function prototype for gethostbyaddr
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages   
(Show other bugs)
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-22 09:19 UTC by Mikael Lindberg
Modified: 2007-11-30 22:10 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Mikael Lindberg 2004-07-22 09:19:37 UTC
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):
man-pages-1.66

How reproducible:
Always

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 20:00:58 UTC
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 11:26:53 UTC
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 18:08:39 UTC
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
NOTES.

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.