Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Aug 1999 14:21:38 -0700 (PDT)
From:      Joe Groff <ognir@humboldt1.com>
To:        bmcgover@cisco.com
Cc:        dan@trinsec.com, hackers@FreeBSD.ORG
Subject:   Re: gethostbyaddr() and threads.
Message-ID:  <199908092121.OAA21266@home.humboldt1.com>
In-Reply-To: <199908092104.RAA06010@bmcgover-pc.cisco.com>

next in thread | previous in thread | raw e-mail | index | archive | help
---Brian McGovern said:
> [snip]
> 
> gethostbyaddr... actually, most of the gethostby* functions... are not
> thread safe. They all use a static buffer in the library.
> 
> Therefore, with threads, if you don't take precautions, I'd expect your
> results to be odd.
>     -Brian
> 
Couldn't this be easily fixed? I haven't looked at the source yet, but I
believe you could replaced the static buffers with a dynamically-allocated list
of buffers, with one for each thread using the gethost functions. Or perhaps
you could just eliminate all the static stuff altogether?

-Joe




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?199908092121.OAA21266>