about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-01-31 08:39:55 +0000
committerUlrich Drepper <drepper@redhat.com>1998-01-31 08:39:55 +0000
commitd67281a7eac124e2f1b498c377dde3432f711039 (patch)
tree77832ea40d41c4c0858f1248829ad2dfdb513786 /nss
parent4eb36693e4452db4679a33c750c0738b73d1ebc5 (diff)
downloadglibc-d67281a7eac124e2f1b498c377dde3432f711039.tar.gz
glibc-d67281a7eac124e2f1b498c377dde3432f711039.tar.xz
glibc-d67281a7eac124e2f1b498c377dde3432f711039.zip
Update.
1998-01-31  Phil Blundell  <philb@gnu.org>

	* configure.in: Add --without-cvs option to suppress automatic
	checkin of regenerated files.
	* config.make: Likewise.
	* Makefile: Respect with-cvs setting.
	* Makerules: Likewise.

	* configure.in: Allow the standalone ARM port to be configured.

1998-01-31  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* grp/getgrgid_r.c: Define USE_NSCD.
	* grp/getgrnam_r.c: Likewise.
	* pwd/getpwuid_r.c: Likewise.
	* pwd/getpwnam_r.c: Likewise.

	* sysdeps/unix/inet/Subdirs: Add nscd subdir.

	* nss/getXXbyYY_r.c: Try at first nscd.

	* nscd/Makefile: New, for the Name Switch Cache Daemon (nscd).
	* nscd/connections.c: New file.
	* nscd/dbg_log.c: New file.
	* nscd/dbg_log.h: New file.
	* nscd/grpcache.c: New file.
	* nscd/nscd.c: New file.
	* nscd/nscd.h: New file.
	* nscd/nscd_conf.c: New file.
	* nscd/nscd_stat.c: New file.
	* nscd/pwdcache.c: New file.

	* nscd/nscd_getgr_r.c: New, client code, linked into libc.
	* nscd/nscd_getpw_r.c: Likewise.
	* nscd/nscd_proto.h: New, prototypes for client functions.

	* nscd/nscd.conf: New, example for a configuration file.
	* nscd/nscd.init: New, example for a startup script.

	* nscd/getgrgid_r.c: Old grp/getgrgid_r version, used from nscd to
	avoid deadlocks.
	* nscd/getgrnam_r.c: Likewise.
	* nscd/getpwnam_r.c: Likewise.
	* nscd/getpwuid_r.c: Likewise.

	* nis/nis_cache.c: New file.
	* nis/nis_cache2.h: New file.
	* nis/nis_cache2_xdr.c: New file.
Diffstat (limited to 'nss')
-rw-r--r--nss/getXXbyYY_r.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index 47df01054e..d20fa34498 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -19,6 +19,7 @@
 
 #include <errno.h>
 #include "nsswitch.h"
+#include <nscd/nscd_proto.h>
 
 /*******************************************************************\
 |* Here we assume several symbols to be defined:		   *|
@@ -51,6 +52,12 @@
 #define INTERNAL(name) INTERNAL1 (name)
 #define INTERNAL1(name) __##name
 
+#ifdef USE_NSCD
+# define NSCD_NAME ADD_NSCD (REENTRANT_NAME)
+# define ADD_NSCD(name) ADD_NSCD1 (name)
+# define ADD_NSCD1(name) __nscd_##name
+#endif
+
 #define FUNCTION_NAME_STRING STRINGIZE (FUNCTION_NAME)
 #define REENTRANT_NAME_STRING STRINGIZE (REENTRANT_NAME)
 #define DATABASE_NAME_STRING STRINGIZE (DATABASE_NAME)
@@ -93,6 +100,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
   lookup_function fct;
   int no_more;
   enum nss_status status = NSS_STATUS_UNAVAIL;
+#ifdef USE_NSCD
+  int nscd_status;
+#endif
 
 #ifdef HANDLE_DIGITS_DOTS
 # define resbuf (*resbuf)
@@ -100,6 +110,15 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
 # undef resbuf
 #endif
 
+#ifdef USE_NSCD
+  nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen H_ERRNO_VAR);
+  if (nscd_status < 1)
+    {
+      *result = nscd_status == 0 ? resbuf : NULL;
+      return nscd_status;
+    }
+#endif
+
   if (startp == NULL)
     {
       no_more = DB_LOOKUP_FCT (&nip, REENTRANT_NAME_STRING, (void **) &fct);