aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--nscd/nscd_getai.c16
-rw-r--r--nscd/nscd_gethst_r.c15
-rw-r--r--sysdeps/x86_64/bits/select.h14
4 files changed, 44 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 9008d28..7696705 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2008-12-29 Ulrich Drepper <drepper@redhat.com>
+ * nscd/nscd_gethst_r.c (nscd_gethst_r): Don't use nscd if
+ LOCALDOMAIN is defined.
+ * nscd/nscd_getai.c (__nscd_getai): Likewise.
+
* sysdeps/x86_64/bits/select.h: New file.
* resolv/res_init.c (__res_vinit): Count all servers in statp->nscount.
diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c
index 56f9637..674a5e7 100644
--- a/nscd/nscd_getai.c
+++ b/nscd/nscd_getai.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
@@ -36,10 +36,24 @@ extern int __nss_not_use_nscd_hosts;
/* We use the mapping from nscd_gethst. */
libc_locked_map_ptr (extern, __hst_map_handle) attribute_hidden;
+/* Defined in nscd_gethst_r.c. */
+extern int __nss_have_localdomain attribute_hidden;
+
int
__nscd_getai (const char *key, struct nscd_ai_result **result, int *h_errnop)
{
+ if (__builtin_expect (__nss_have_localdomain >= 0, 0))
+ {
+ if (__nss_have_localdomain == 0)
+ __nss_have_localdomain = getenv ("LOCALDOMAIN") != NULL ? 1 : -1;
+ if (__nss_have_localdomain > 0)
+ {
+ __nss_not_use_nscd_hosts = 1;
+ return -1;
+ }
+ }
+
size_t keylen = strlen (key) + 1;
int gc_cycle;
int nretries = 0;
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index a211404..aea8288 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -97,12 +97,25 @@ libc_freeres_fn (hst_map_free)
}
+int __nss_have_localdomain attribute_hidden;
+
static int
internal_function
nscd_gethst_r (const char *key, size_t keylen, request_type type,
struct hostent *resultbuf, char *buffer, size_t buflen,
struct hostent **result, int *h_errnop)
{
+ if (__builtin_expect (__nss_have_localdomain >= 0, 0))
+ {
+ if (__nss_have_localdomain == 0)
+ __nss_have_localdomain = getenv ("LOCALDOMAIN") != NULL ? 1 : -1;
+ if (__nss_have_localdomain > 0)
+ {
+ __nss_not_use_nscd_hosts = 1;
+ return -1;
+ }
+ }
+
int gc_cycle;
int nretries = 0;
diff --git a/sysdeps/x86_64/bits/select.h b/sysdeps/x86_64/bits/select.h
index c217c26..7f23cb5 100644
--- a/sysdeps/x86_64/bits/select.h
+++ b/sysdeps/x86_64/bits/select.h
@@ -20,13 +20,21 @@
# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
#endif
+#include <bits/wordsize.h>
+
#if defined __GNUC__ && __GNUC__ >= 2
# if __WORDSIZE == 64
# define __FD_ZERO_STOS "stosq"
+# define __FD_SET_BTS "btsq"
+# define __FD_CLR_BTR "btrq"
+# define __FD_ISSET_BT "btq"
# else
# define __FD_ZERO_STOS "stosl"
+# define __FD_SET_BTS "btsl"
+# define __FD_CLR_BTR "btrl"
+# define __FD_ISSET_BT "btl"
# endif
# define __FD_ZERO(fdsp) \
@@ -41,19 +49,19 @@
} while (0)
# define __FD_SET(fd, fdsp) \
- __asm__ __volatile__ ("btsl %1,%0" \
+ __asm__ __volatile__ (__FD_SET_BTS " %1,%0" \
: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \
: "r" (((int) (fd)) % __NFDBITS) \
: "cc","memory")
# define __FD_CLR(fd, fdsp) \
- __asm__ __volatile__ ("btrl %1,%0" \
+ __asm__ __volatile__ (__FD_CLR_BTR " %1,%0" \
: "=m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \
: "r" (((int) (fd)) % __NFDBITS) \
: "cc","memory")
# define __FD_ISSET(fd, fdsp) \
(__extension__ \
({register char __result; \
- __asm__ __volatile__ ("btl %1,%2 ; setcb %b0" \
+ __asm__ __volatile__ (__FD_ISSET_BT " %1,%2 ; setcb %b0" \
: "=q" (__result) \
: "r" (((int) (fd)) % __NFDBITS), \
"m" (__FDS_BITS (fdsp)[__FDELT (fd)]) \