Subject: lib/15591: gethostent - does it exist or not?
To: None <gnats-bugs@gnats.netbsd.org>
From: None <lhp@toft-hp.dk>
List: netbsd-bugs
Date: 02/13/2002 02:40:38
>Number:         15591
>Category:       lib
>Synopsis:       gethostent is not in libc (where it should be acc. to man) , but prototype remains in /usr/include/netdb.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 12 17:41:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Lasse Hillerĝe Petersen
>Release:        NetBSD 1.5.1
>Organization:
	Just being myself
>Environment:
	
System: NetBSD galaxy.toft-hp.dk 1.5.2 NetBSD 1.5.2 (GENERIC_LAPTOP) #3: Sat Aug 18 23:43:41 CEST 2001 he@hamster.urc.uninett.no:/usr/src/sys/arch/i386/compile/GENERIC_LAPTOP i386


>Description:
	
It seems gethostent() has been removed from libc at some point in time. However, it remains documented in a manpage, and a
prototype remains in /usr/include/netdb.h

I stumbled upon this while trying to use my just compiled native jdk-1.3.1. A simple hello program ran fine, but a program 
that used jdbc complained about gethostent being an undefined symbol.



>How-To-Repeat:
	
cc -x c - <<END
#include <netdb.h>

main() {
        (void) gethostent();
}
END

>Fix:
	
Well, undo the disabling in libc or fix the headers and the manpage. I tried to fix the source file
/usr/src/lib/libc/net/gethnamaddr.c by amending the relevant #if, but I haven't succeeded. I think I
prefer fixing libc to making the appropriate fix to the JDK source. :-)

But for this problem, it seems the http://www.eyesbeyond.com/freebsddom/java/jdk13.html JDK works OK.
I had hoped getting Tomcat running on a native JVM tonight though - no such luck, and now it's 0230 in
the morning :-( *GOODNIGHT*

-Lasse
>Release-Note:
>Audit-Trail:
>Unformatted: