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
return & thread_specific_h_errno[tid];
}
+
+#undef _res
+extern struct __res_state _res;
+
struct __res_state* __res_state ( void )
{
int tid;
/* '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];
}