[Top][All Lists]

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


From: Padraig Brady
Subject: gethostbyname_r
Date: Thu, 04 Apr 2002 17:03:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311

I'm having serious trouble with this function
in a multithreaded application.

1. It seems to use a global lock! so multiple
   threads block in it. Is this correct? Can
   it be changed?
2. When DNS settings are changed while the
   multithreaded app is running it seems to
   get completely confused and will arbitrarily
   fail the lookup for specific hosts. I.E.
   looking up "cygnus.com" will sometimes work
   but mostly fail. Specifically adding a nameserver
   to /etc/resolv.conf while the app is running will
   cause lookups to arbitrarily fail. If the app starts
   with the correct nameserver in /etc/resolv.conf
   then all is OK.
3. In the e.g. below, does the function return it's
   error code in, errno, res or herr? I've seen
   e.g. code on the net using all 3 methods! My
   application uses res.

   res = gethostbyname_r(,,,,,&herr);


reply via email to

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