| >After quite an exhausting night (of all the ways I didn't want to spend my
| >Sunday...) I've managed to track down a problem that has been frustrating me
| >all night.  The problem exists with multiple threads calling gethostbyaddr()
| >(not necessarily at the same time).  
| 
| src/lib/libc/net/gethostbydns.c seems to use a load of static
| variables in a non-thread-safe fashion.

Yes, I noticed that as well.  I also noticed that gethostbyaddr_r worked
"less" than gethostbyaddr did (the result was that all threads ended up 
thrashing each other, and not of them continued on).  I was going to use
res_query, but noticed that it too used static buffers (although it looks
pretty easy to fix).

Would anyone be offended if I were to produce a few patches to fix up these
routines once and for all?  Should I just produce a few #ifdef _THREAD_SAFEs
or try full blown routines (gethostbyaddr_r, res_query_r)?


Thanks,

Dan


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to