Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Aug 1999 15:41:20 PDT
From:      "Steve Tarkalson" <steve_tarkalson@hotmail.com>
To:        ognir@humboldt1.com, bmcgover@cisco.com
Cc:        dan@trinsec.com, hackers@FreeBSD.ORG
Subject:   Re: gethostbyaddr() and threads.
Message-ID:  <19990809224120.39659.qmail@hotmail.com>

next in thread | raw e-mail | index | archive | help
this is solved by one of two methods:
   1-) require the caller of gethostbyaddr() to supply a pointer to
       a hostent struct which will be filled.
or 2-) the library uses thread specific storage which is re-used in
       each call.


>From: Joe Groff <ognir@humboldt1.com>
>Reply-To: ognir@humboldt1.com
>To: bmcgover@cisco.com
>CC: dan@trinsec.com, hackers@FreeBSD.ORG
>Subject: Re: gethostbyaddr() and threads.
>Date: Mon, 9 Aug 1999 14:21:38 -0700 (PDT)
>MIME-Version: 1.0
>From owner-freebsd-hackers@freebsd.org Mon Aug  9 14:22:43 1999
>Received: by hub.freebsd.org (Postfix, from userid 538)id 13F1E152DC; Mon,  
>9 Aug 1999 14:24:36 -0700 (PDT)
>Received: from localhost (localhost [127.0.0.1])by hub.freebsd.org 
>(Postfix) with SMTPid F31551CD65D; Mon,  9 Aug 1999 14:24:35 -0700 
>(PDT)(envelope-from owner-freebsd-hackers)
>Received: by hub.freebsd.org (bulk_mailer v1.12); Mon, 9 Aug 1999 14:24:35 
>-0700
>Delivered-To: freebsd-hackers@freebsd.org
>Received: from home.humboldt1.com (home.humboldt1.com [206.13.45.1])by 
>hub.freebsd.org (Postfix) with ESMTP id 9598214D75for 
><hackers@FreeBSD.ORG>; Mon,  9 Aug 1999 14:24:29 -0700 (PDT)(envelope-from 
>ognir@humboldt1.com)
>Received: from shovel.groff (ppp176-pm5.humboldt1.com [207.104.21.169])by 
>home.humboldt1.com (Pro-8.9.2/Pro-8.9.2) with SMTP id OAA21266;Mon, 9 Aug 
>1999 14:21:38 -0700 (PDT)
>Message-Id: <199908092121.OAA21266@home.humboldt1.com>
>In-Reply-To: <199908092104.RAA06010@bmcgover-pc.cisco.com>
>X-Mailer: XCmail 1.0.0 - with PGP support, PGP engine version 0.5 (FreeBSD)
>X-Mailerorigin: http://www.fsai.fh-trier.de/~schmitzj/Xclasses/XCmail/
>Sender: owner-freebsd-hackers@FreeBSD.ORG
>X-Loop: FreeBSD.ORG
>Precedence: bulk
>
>---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
>


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.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?19990809224120.39659.qmail>