LinuxThreads resolver fix.
Mark Kettenis
kettenis@wins.uva.nl
Tue Jul 25 09:59:00 GMT 2000
Here's the promised alternative to Jakub's patch to fix problems with
using the resolver state in the main thread of a multithreaded program.
Mark
2000-07-25 Mark Kettenis <kettenis@gnu.org>
* internals.h(__RES_PTHREAD_INTERNAL): Remove define.
* pthread.c: Include <resolv.h>.
(_res): Undefine. Add extern declaration.
Index: linuxthreads/internals.h
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/internals.h,v
retrieving revision 1.52
diff -u -p -r1.52 internals.h
--- linuxthreads/internals.h 2000/07/24 16:29:07 1.52
+++ linuxthreads/internals.h 2000/07/25 16:49:08
@@ -20,15 +20,12 @@
/* Includes */
#include <limits.h>
+#include <resolv.h>
#include <setjmp.h>
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <bits/libc-tsd.h> /* for _LIBC_TSD_KEY_N */
-
-#define __RES_PTHREAD_INTERNAL
-#include <resolv.h> /* for per-thread resolver context */
-
#include "pt-machine.h"
#include "semaphore.h"
Index: linuxthreads/pthread.c
===================================================================
RCS file: /cvs/glibc/libc/linuxthreads/pthread.c,v
retrieving revision 1.58
diff -u -p -r1.58 pthread.c
--- linuxthreads/pthread.c 2000/07/24 17:23:50 1.58
+++ linuxthreads/pthread.c 2000/07/25 16:49:09
@@ -30,6 +30,12 @@
#include "spinlock.h"
#include "restart.h"
+/* We need the global/static resolver state here. */
+#include <resolv.h>
+#undef _res
+
+extern struct __res_state _res;
+
/* Sanity check. */
#if __ASSUME_REALTIME_SIGNALS && !defined __SIGRTMIN
# error "This must not happen; new kernel assumed but old headers"
More information about the Libc-hacker
mailing list