AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20061205183821.6f12fa50@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<larry.scheer@onstor.com>,<tim.gardner@onstor.com>,<jay.michlin@onstor.com>,<maxim.kozlovsky@onstor.com>,<jonathan.goldick@onstor.com>,<brian.deforest@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E0A93FC@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Tue, 5 Dec 2006 18:41:49 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Larry Scheer" <larry.scheer@onstor.com>
Cc: "Tim Gardner" <tim.gardner@onstor.com>, "Jay Michlin"
 <jay.michlin@onstor.com>, Maxim Kozlovsky <maxim.kozlovsky@onstor.com>,
 Jonathan Goldick <jonathan.goldick@onstor.com>, Brian DeForest
 <brian.deforest@onstor.com>
Subject: Re: A summary of my previous work porting our SSC applications to
 NETBSD
Message-ID: <20061205184149.79b1c90f@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E0A93FC@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E0A93FC@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.5.6 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Tue, 5 Dec 2006 18:20:31 -0800 "Larry Scheer"
<larry.scheer@onstor.com> wrote:


> The following is a summary of what I found while building our SSC
> applications:
> 
> The function gethostnamadr_mutex_lock (and unlock.) was one of the
> unresolved functions referenced in our code. This is used in the
> following libraries which are used in many places in the SSC:
> 		lib/libcluster.so
> 		libnfxnis.so
> 		lib/librmc.so
> 
> Gethostnamadr_mutex_lock/unlock appears to be code Onstor created and
> added to gethostnamaddr in the OpenBSD distribution. Fortunately our
> changes appear to be contained in blocks defined by ONSTOR_CHANGE. The
> function gethostnamadr isn't in NetBSD. They use gethnamaddr which
> provides similar functionality. I found definitions for this function
> in usr/include/resolv.h and src/lib/libc/net/gethostnamadr.c inside a
> block starting: #if defined(ONSTOR_CHANGE).

Does anybody have any idea why we created such a function?  Or should I
say 'why on earth?'  The only thing I can think of is that this
function in the C library had local static data that can be stepped on
by overlapping callers and hence not MP safe.  Any bug like that has
long since been fixed in the glibc, or, a reentrant version of the
function has been added.

The function name gethostnamadr is not a standard sockets API function
name I'm familiar with.  Long time socket API function gethostbyname()
has a reentrant (MP safe) version now in glibc by the name of
gethostbyname_r() and of course the gnu extension gethostbyname2_r().