guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code review for thread safeness


From: Ken Raeburn
Subject: Re: Code review for thread safeness
Date: Sat, 18 Jun 2005 01:03:06 -0400

Oh, how annoying. In going back over some old email messages in my way-too-full mailbox, I just noticed these replies to my message that I'd never read! I apologize for not replying before.

On Mar 9, 2005, at 11:23, Andreas Rottmann wrote:
Marius Vollmer <address@hidden> writes:
Ken Raeburn <address@hidden> writes:
If at all possible, this code should be switched to use get*by*_r, or
in the gethostby* cases, perhaps getaddrinfo and getnameinfo.
Yes, definitely.  Could you help with that?
FWIW, I just stole some code from GNet (http://www.gnetlibrary.org)
for another project. You might want to have a glance at how they do
this stuff, since it seems there are different flavours of
gethostbyname_r (glibc, HPUX, Solaris). The relevant code is in
inetaddr.c and configure.ac (detection). GNet is LGPL-licenced BTW.

I've spent some time dealing with getaddrinfo/gethostbyname_r/etc for work, and found this to be a rather annoying morass to dive into. There are at least three variants of gethostbyname_r among the systems I'm supporting, and some (even modern systems like NetBSD and Mac OS X) don't have it at all; almost all of the systems have getaddrinfo, though different implementations have different minor bugs. I've also gone through writing code to determine which flavors of which routines are available, and implementing a wrapper to deal with all the variants.

In the long term, I think getaddrinfo is what we want to be using. But for the short term, hacking up the gethostby* routines to use the _r versions when they're available shouldn't be that hard. I'll look into it.

(Oh, eww, we've got 'gethostent' support too. Bleah. Well, glibc at least seems to have a gethostent_r...)

Ken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]