Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Apr 2000 10:51:03 -0600
From:      Wes Peters <wes@softweyr.com>
To:        Ming Zhang <ming@yahoo-inc.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Multithread safe gethostbyname() ?
Message-ID:  <38F89DF7.4633F025@softweyr.com>
References:  <Pine.BSF.4.10.10004111813310.81762-100000@pious.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Ming Zhang wrote:
> 
> Is there a MT-safe implementation of gethostbyname() in FreeBSD (3.4/4.0)?
> 
> On Solaris there is gethostbyname_r().  Calling gethostbyname() with in
> two threads cause both threads to block.
> 
> I know the "struct hostent" is static in gethostbyname(), however it seems
> like the socket that is used to get the DNS info is static too.

If you look at the current implementatino of the getXbyY functions, you'll
find they are jungles full of static data.  I've been (slowly) writing the
_r function missing from FreeBSD, documenting the hidden ones I've found,
and generally fleshing this out, but I've left getXbyY to last because
they're fugly.

I'll start with gethostbyname_r because that is the most useful, but I 
cannot promise when that might be.

-- 
            "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                         Softweyr LLC
wes@softweyr.com                                           http://softweyr.com/




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?38F89DF7.4633F025>