From owner-freebsd-hackers Sun Sep 15 4:19: 9 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 6B11A37B400 for ; Sun, 15 Sep 2002 04:18:56 -0700 (PDT) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C86143E4A for ; Sun, 15 Sep 2002 04:18:53 -0700 (PDT) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id OHD27335; Sun, 15 Sep 2002 14:18:32 +0300 (EEST) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.12.3/8.12.3) id g8FBEMXN001277; Sun, 15 Sep 2002 14:14:22 +0300 (EEST) (envelope-from netch) Date: Sun, 15 Sep 2002 14:14:22 +0300 From: Valentin Nechayev To: Terry Lambert Cc: Jev , hackers@FreeBSD.ORG Subject: Re: gethostbyname_r() fbsd equiv? Message-ID: <20020915111422.GA1077@iv.nn.kiev.ua> References: <20020913145830.GB41842@ecad.org> <3D820700.DB53B0F9@mindspring.com> <20020913160214.GB42538@ecad.org> <3D820DD0.985F9C66@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D820DD0.985F9C66@mindspring.com> X-42: On Organization: Dark side of coredump 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 Fri, Sep 13, 2002 at 09:09:52, tlambert2 (Terry Lambert) wrote about "Re: gethostbyname_r() fbsd equiv?": >> The "real" gethostbyname_r() that takes 3 params is what the code Im >> attempting to port uses. As I implied earlier, my C competence is far >> below par, so for me to write this code would be far for trivial for >> _me_ :) TL> This is the HP/UX or AIX version of the interface. SUSv3 doesn't know any gethostbyname_r. One can select either HP-UX/AIX or Solaris/Linux version of interface, but the more correct way is possibly to inplement getaddrinfo() in thread-safe way. getaddrinfo() is known even for Microsoft (latest versions). For now I can't understand why thread-safe resolver from BIND >= 8.2 wasn't imported. For applications where it is nesessary (e.g. milter filter with extended checking of sender validity), we had to compile libbind and link it in non-natural way.;( getaddrinfo/getnameinfo can be rewritten for thread-safe resolver mechanically, without advanced thinking. P.S. BIND source has version of gethostbyaddr_r and only it should be named as canonical. /netch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message