NetBSD-Bugs archive

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

Re: lib/46661: libpthread shouldn't provide __res_state()



The following reply was made to PR lib/46661; it has been noted by GNATS.

From: christos%zoulas.com@localhost (Christos Zoulas)
To: gnats-bugs%NetBSD.org@localhost, lib-bug-people%netbsd.org@localhost, 
        gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/46661: libpthread shouldn't provide __res_state()
Date: Thu, 5 Jul 2012 11:20:50 -0400

 On Jul 5,  3:10pm, river%RT.UK.EU.ORG@localhost (River Tarnell) wrote:
 -- Subject: lib/46661: libpthread shouldn't provide __res_state()
 | 
 | I've looked through the code and I don't see any reason why _res can't be
 | used from a program that links with -lpthread.  While it's not a thread-safe
 | interface, using it from a single thread would appear to work fine.
 
 There is plenty good reason for not doing that; using the non-threaded
 versions of the resolver variable will not just "work fine". Just read
 the code (in res_send.c).
 
 Instead start using the thread-safe versions of the functions (it is
 as simple as changing res_send() to res_nsend() for example and managing
 your own _res_state with res_ninit()/res_nclose()). They've been there for
 almost a decade now, and there is no excuse for dicking with _res directly
 anymore!
 
 christos
 


Home | Main Index | Thread Index | Old Index