You're viewing a comment by Derek Callaway and its responses.

October 06, 2009, 15:13

You could have used gethostbyname2_r() in C. The default resolver functions aren't re-entrant because they use thread-specific data in libc. It's not standard, but it's included in netdb.h on both Linux and BSD. I've successfully used the standard gethostbyname() function in concurrent programming by isolating the critical section with a POSIX Threads mutex. There's a download link to the source code of my nameserver security scanner which demonstrates this here:

http://www.security-database.com/toolswatch/PorkBind-updated-to-1-3.html

Reply To This Comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type first 3 letters of your name: (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.