summaryrefslogtreecommitdiffstats
path: root/lib/libc/resolv/mtctxres.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2006-03-21 15:37:16 +0000
committerume <ume@FreeBSD.org>2006-03-21 15:37:16 +0000
commit03859cff097cd048acc43548684969ea0b3e7f7e (patch)
tree6a044a277848f8d42cf8a314d701efea03241963 /lib/libc/resolv/mtctxres.c
parent92fc9582cfae8294317ce04ae7e2d14f94dd3ca8 (diff)
downloadFreeBSD-src-03859cff097cd048acc43548684969ea0b3e7f7e.zip
FreeBSD-src-03859cff097cd048acc43548684969ea0b3e7f7e.tar.gz
- Merge our local changes.
- Exclude unnecessary functions for us.
Diffstat (limited to 'lib/libc/resolv/mtctxres.c')
-rw-r--r--lib/libc/resolv/mtctxres.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c
index f33cf11..86b5a79 100644
--- a/lib/libc/resolv/mtctxres.c
+++ b/lib/libc/resolv/mtctxres.c
@@ -1,13 +1,18 @@
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <port_before.h>
#ifdef DO_PTHREADS
#include <pthread.h>
+#ifdef _LIBC
+#include <pthread_np.h>
+#endif
#endif
#include <errno.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <resolv_mt.h>
-#include <irs.h>
#include <port_after.h>
#ifdef DO_PTHREADS
@@ -40,6 +45,7 @@ _mtctxres_init(void) {
}
#endif
+#ifndef _LIBC
/*
* To support binaries that used the private MT-safe interface in
* Solaris 8, we still need to provide the __res_enable_mt()
@@ -54,6 +60,7 @@ int
__res_disable_mt(void) {
return (0);
}
+#endif
#ifdef DO_PTHREADS
static int
@@ -99,6 +106,11 @@ ___mtctxres(void) {
#ifdef DO_PTHREADS
mtctxres_t *mt;
+#ifdef _LIBC
+ if (pthread_main_np() != 0)
+ return (&sharedctx);
+#endif
+
/*
* This if clause should only be executed if we are linking
* statically. When linked dynamically _mtctxres_init() should
OpenPOWER on IntegriCloud