Hi ho
I'll start with admit it: I have tried, I have failed, I have searched for
answers and failed there too.
Now, I've spent hours on this problem and I believe there are others that
*have* spent a lot of time or *will* spend a lot of time on this. I may save
some of my time, and others future time.
Let me come to it: gethostbyname_r() is the thread-safe function to use for
name resolving in a bunch of systems. If present, it is used in (at least)
three different ways. With 3, 5 or 6 arguments.
First out, I have to write a configure-test that figures out what version
your system uses. I think I've managed to cut and paste together a test from
sources on the net (although it may fail on HPUX 10.20 as it seems right
now).
Then it needs to be adjusted in the source code. I've failed there (too) so
far with the 3-argument version which seem to not lookup names properly.
(AIX, HPUX and I believe Digital Unix). Linux (6 args) and the Solaris+IRIX
(5 args) versions seem fine. Not having access to such machines myself makes
debugging and researching this subject very time consuming and awkward.
The similar problem exists for gethostbyaddr_r() and others.
Is there anyone that can point to a good, reliable autoconf-test that works
for all the major unices, preferably together with some example source code
in how the gethostby*_r() stuff could be written?
If you have something good written in this area that you would consider
sharing, could you please provide me with some input, links or similar?
I'll of course collect the results of this request to present later.
--
Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol