From owner-freebsd-hackers Mon Aug 9 6:55: 9 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from november.jaded.net (november.jaded.net [216.94.113.4]) by hub.freebsd.org (Postfix) with ESMTP id 70EEB15256 for ; Mon, 9 Aug 1999 06:55:03 -0700 (PDT) (envelope-from dan@november.jaded.net) Received: (from dan@localhost) by november.jaded.net (8.9.3/8.9.3+trinsec_nospam) id KAA43935; Mon, 9 Aug 1999 10:06:26 -0400 (EDT) Date: Mon, 9 Aug 1999 10:06:26 -0400 From: Dan Moschuk To: Tony Finch Cc: hackers@freebsd.org Subject: Re: gethostbyaddr() and threads. Message-ID: <19990809100626.A43835@trinsec.com> References: <19990808204333.A40377@trinsec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: ; from Tony Finch on Mon, Aug 09, 1999 at 01:41:24PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG | >After quite an exhausting night (of all the ways I didn't want to spend my | >Sunday...) I've managed to track down a problem that has been frustrating me | >all night. The problem exists with multiple threads calling gethostbyaddr() | >(not necessarily at the same time). | | src/lib/libc/net/gethostbydns.c seems to use a load of static | variables in a non-thread-safe fashion. Yes, I noticed that as well. I also noticed that gethostbyaddr_r worked "less" than gethostbyaddr did (the result was that all threads ended up thrashing each other, and not of them continued on). I was going to use res_query, but noticed that it too used static buffers (although it looks pretty easy to fix). Would anyone be offended if I were to produce a few patches to fix up these routines once and for all? Should I just produce a few #ifdef _THREAD_SAFEs or try full blown routines (gethostbyaddr_r, res_query_r)? Thanks, Dan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message