From: Julian Seward Date: Tue, 6 Aug 2002 09:06:18 +0000 (+0000) Subject: Merge rev 1.91: X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c207d270bd436c962f523e3c36d5be45336de565;p=thirdparty%2Fvalgrind.git Merge rev 1.91: Simulate resolver-specific state as per the real libpthread.so, wherein the root thread (tid 1) always uses _res as exported from libc.so as its state. This fixes the name lookup problems in KAtlantik. git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@552 --- diff --git a/vg_libpthread.c b/vg_libpthread.c index 60c4dc95ff..994cdb74e0 100644 --- a/vg_libpthread.c +++ b/vg_libpthread.c @@ -1354,6 +1354,10 @@ int* __h_errno_location ( void ) return & thread_specific_h_errno[tid]; } + +#undef _res +extern struct __res_state _res; + struct __res_state* __res_state ( void ) { int tid; @@ -1364,6 +1368,8 @@ struct __res_state* __res_state ( void ) /* 'cos I'm paranoid ... */ if (tid < 1 || tid >= VG_N_THREADS) barf("__res_state: invalid ThreadId"); + if (tid == 1) + return & _res; return & thread_specific_res_state[tid]; }