From owner-freebsd-hackers Fri Sep 27 11:45:17 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D35E337B401 for ; Fri, 27 Sep 2002 11:45:15 -0700 (PDT) Received: from angelica.unixdaemons.com (angelica.unixdaemons.com [209.148.64.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26EAE43E4A for ; Fri, 27 Sep 2002 11:45:15 -0700 (PDT) (envelope-from hiten@angelica.unixdaemons.com) Received: from angelica.unixdaemons.com (hiten@localhost.unixdaemons.com [127.0.0.1]) by angelica.unixdaemons.com (8.12.5/8.12.1) with ESMTP id g8RIj7VI043852; Fri, 27 Sep 2002 14:45:07 -0400 (EDT) X-Authentication-Warning: angelica.unixdaemons.com: Host hiten@localhost.unixdaemons.com [127.0.0.1] claimed to be angelica.unixdaemons.com Received: (from hiten@localhost) by angelica.unixdaemons.com (8.12.5/8.12.1/Submit) id g8RIj4gH043845; Fri, 27 Sep 2002 14:45:04 -0400 (EDT) (envelope-from hiten) Date: Fri, 27 Sep 2002 14:45:04 -0400 From: Hiten Pandya To: Terry Lambert Cc: Jev , freebsd-hackers@freebsd.org Subject: Re: gethostbyname_r() fbsd equiv? Message-ID: <20020927144504.A42463@angelica.unixdaemons.com> References: <20020913145830.GB41842@ecad.org> <3D820700.DB53B0F9@mindspring.com> <3D820BE9.7E69C57E@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <3D820BE9.7E69C57E@mindspring.com>; from tlambert2@mindspring.com on Fri, Sep 13, 2002 at 09:01:45AM -0700 X-Operating-System: FreeBSD i386 X-Public-Key: http://www.pittgoth.com/~hiten/pubkey.asc X-URL: http://www.unixdaemons.com/~hiten X-PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Sep 13, 2002 at 09:01:45AM -0700, Terry Lambert wrote the words in effect of: > Terry Lambert wrote: > > Jev wrote: > > > Im trying to build some software on freebsd, which wants to use > > > the thread safe gethostbyname_r(). Despite having very bad C skills im > > > going to attempt to patch it. What would I use in place of > > > gethostbyname_r() on freebsd? > > > > Do you need the real gethostbyname_r(), or do you need the > > bastardized Linux version? The real version has the prototype: > > In case anyone cares, it's the pre-knowing the buffer size, with > no ability to return partial results and at the same time indicate > the buffer is to short, and the h_errno pointer and the return > of the hostent structure whose address was passed, rather than an > int, that I object to in the Linux interface. > > And yes, I know it matches the Solaris interface. Aplogies, for the late arrival of this mail. I do not read -hackers very much these days. But I found this worth the while to comment. Doesnt getaddrinfo() do whatever gethostbyname() can do? And also, if my source of information is correct, getaddrinfo() should be thread-safe and also, it is under the POSIX p1003.1g. Regards. -- Hiten Pandya http://www.unixdaemons.com/~hiten hiten@unixdaemons.com, hiten@uk.FreeBSD.org, hiten@xMach.org PGP: http://pgp.mit.edu:11371/pks/lookup?search=Hiten+Pandya&op=index To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message