List Info

Thread: gethostbyname_r() ?




gethostbyname_r() ?
user name
2006-07-18 06:50:06
Hi,

>>> Tue, 18 Jul 2006 15:01:44 +0900,
>>> JINMEI Tatuya <jinmeiisl.rdc.toshiba.co.jp>
said:

jinmei> The major reason why getaddrinfo() was regarded
as not thread-safe at
jinmei> that time was:

jinmei> - a (few) static variables used in getaddrinfo.c
(this varied among
jinmei>   BSD variants.  I don't remember whether it was
the case for NetBSD)
jinmei> - because the underlying libraries (res_xxx
and/or getservbyname())
jinmei>   were not thread safe

jinmei> But at least recent current code does not seem to
have any of these
jinmei> problems, and the implementation now looks like
thread safe.

I think getservbyname(3) is still not thread-safe.  This
issue will be
fixed by:

	- _servent_data should be allocated per thread, or
	- getaddrinfo(3) should use getservbyname_r(3).

Sincerely,

--
Hajimu UMEMOTO  Internet Mutual Aid Society Yokohama,
Japan
umemahoroba.org  ume{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )