summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-29 17:32:35 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-29 17:32:35 +0000
commit993b3242cdc37152fbbc7fbd5ce22b2734b04b23 (patch)
treed3c4fc94e027728055d96a370d034b6fb685cf85 /nss/nsswitch.c
parente7fd8a39abd3a9c9d2139e686b17efb5dc3bf444 (diff)
downloadglibc-993b3242cdc37152fbbc7fbd5ce22b2734b04b23.tar.gz
glibc-993b3242cdc37152fbbc7fbd5ce22b2734b04b23.tar.xz
glibc-993b3242cdc37152fbbc7fbd5ce22b2734b04b23.zip
Update.
1997-03-29 17:39  Ulrich Drepper  <drepper@cygnus.com>

	* math/Makefile (routines): Add carg, s_ccosh and s_csinh.

	* math/complex.h: Add C++ protection.

	* math/libm-test.c (cexp_test): Correct a few bugs.
	(csinh_test): New function.
	(ccosh_test): New function.
	(cacos_test): New function.
	(cacosh_test): New function.
	(casinh_test): New function.
	(catanh_test): New function.
	(main): Add calls to csinh_test and ccosh_test.

	* misc/Makefile (tests): Add tst-tsearch.
	Add rule to link tst-tsearch against libm.
	* misc/tsearch.c: Rewritten to use Red-Black-Tree algorithm by
	Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>.
	* misc/tst-tsearch.c: New file.

	* stdio-common/bug5.c: Clear LD_LIBRARY_PATH environment variable
	before using system.
	* stdio-common/test-popen.c: Clear LD_LIBRARY_PATH environment variable
	before using popen.

	* sysdeps/libm-ieee754/s_cexp.c: Correct handling of special cases.
	* sysdeps/libm-ieee754/s_cexpf.c: Likewise.
	* sysdeps/libm-ieee754/s_cexpl.c: Likewise.

	* sysdeps/libm-i387/s_cexp.S: New file.  ix87 specific implementation
	of complex exponential function.
	* sysdeps/libm-i387/s_cexpf.S: New file.
	* sysdeps/libm-i387/s_cexpl.S: New file.

	* sysdeps/libm-ieee754/s_ccosh.c: New file.  Implementation of
	complex cosh function.
	* sysdeps/libm-ieee754/s_ccoshf.c: New file.
	* sysdeps/libm-ieee754/s_ccoshl.c: New file.
	* sysdeps/libm-ieee754/s_csinh.c: New file.  Implementation of
	complex sinh function.
	* sysdeps/libm-ieee754/s_csinhf.c: New file.
	* sysdeps/libm-ieee754/s_csinhl.c: New file.

	* math/carg.c: New file.  Generic implementatio of carg function.
	* math/cargf.c: New file.
	* math/cargl.c: New file.

1997-03-29 16:07  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/posix/system.c: Update copyright.

1997-03-29 04:18  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dl-error.c (_dl_catch_error): Add another argument which is
	passed to OPERATE.
	(_dl_receive_error): Likewise.
	* elf/link.h: Change prototypes for _dl_catch_error and
	_dl_receive_error to reflect above change.
	* elf/dl-deps.c: Don't use nested function.  Call _dl_catch_error
	with additional argument with pointer to data.
	* elf/dlclose.c: Likewise.
	* elf/dlerror.c: Likewise.
	* elf/dlopen.c: Likewise.
	* elf/dlsym.c: Likewise.
	* elf/dlvsym.c: Likewise.
	* elf/rtld.c: Likewise.
	* nss/nsswitch.c: Likewise.
	Patch by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>.

1997-03-28 21:14  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* elf/dl-error.c: Manually set up the values of "c", this avoids a
	call to memcpy and a zero 152 bytes structure.

	* sysdeps/sparc/dl-machine.h (elf_machine_rela): Test
	RTLD_BOOTSTRAP to avoid performing relative relocs on a second
	pass.

	* sysdeps/sparc/udiv_qrnnd.S: Make the code PIC aware.

	* sysdeps/unix/sysv/linux/sparc/Dist: Add kernel_stat.h and
	kernel_sigaction.h

	Add Linux/SPARC specific definitions.
	* sysdeps/unix/sysv/linux/sparc/fcntlbits.h: New file.
	* sysdeps/unix/sysv/linux/sparc/ioctls.h: New file.
	* sysdeps/unix/sysv/linux/sparc/kernel_sigaction.h: New file.
	* sysdeps/unix/sysv/linux/sparc/kernel_stat.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sigaction.h: New file.
	* sysdeps/unix/sysv/linux/sparc/signum.h: New file.
	* sysdeps/unix/sysv/linux/sparc/termbits.h: New file.

1997-03-28 13:06  Philip Blundell  <pjb27@cam.ac.uk>

	* sysdeps/posix/getaddrinfo.c (gaih_inet_serv): Use
	__getservbyname_r() not getservbyname().
	(BROKEN_LIKE_POSIX): Define to 1 so we get strict POSIX behaviour.
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c73
1 files changed, 50 insertions, 23 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 5bcacf296d..f36fe9607d 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -241,13 +241,13 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
 
 
 static int
-nss_dlerror_run (void (*operate) (void))
+nss_dlerror_run (void (*operate) (void *), void *args)
 {
   char *last_errstring = NULL;
   const char *last_object_name = NULL;
   int result;
 
-  (void) _dl_catch_error (&last_errstring, &last_object_name, operate);
+  (void) _dl_catch_error (&last_errstring, &last_object_name, operate, args);
 
   result = last_errstring != NULL;
   if (result)
@@ -257,6 +257,42 @@ nss_dlerror_run (void (*operate) (void))
 }
 
 
+struct do_open_args
+{
+  /* Argument to do_open.  */
+  char *shlib_name;
+  service_user *ni;
+};
+
+struct get_sym_args
+{
+  /* Arguments to get_sym.  */
+  struct link_map *map;
+  char *name;
+
+  /* Return values of get_sym.  */
+  ElfW(Addr) loadbase;
+  const ElfW(Sym) *ref;
+};
+
+static void
+do_open (void *a)
+{
+  struct do_open_args *args = (struct do_open_args *) a;
+  /* Open and relocate the shared object.  */
+  args->ni->library->lib_handle = _dl_open (args->shlib_name, RTLD_LAZY);
+}
+
+static void
+get_sym (void *a)
+{
+  struct get_sym_args *args = (struct get_sym_args *) a;
+  struct link_map *scope[2] = { args->map, NULL };
+  args->ref = NULL;
+  args->loadbase = _dl_lookup_symbol (args->name, &args->ref,
+				      scope, args->map->l_name, 0);
+}
+
 /* Comparison function for searching NI->known tree.  */
 static int
 known_compare (const void *p1, const void *p2)
@@ -332,21 +368,19 @@ nss_lookup_function (service_user *ni, const char *fct_name)
 	      /* Load the shared library.  */
 	      size_t shlen = (7 + strlen (ni->library->name) + 3
 			      + strlen (__nss_shlib_revision) + 1);
-	      char shlib_name[shlen];
 
-	      void do_open (void)
-		{
-		  /* Open and relocate the shared object.  */
-		  ni->library->lib_handle = _dl_open (shlib_name, RTLD_LAZY);
-		}
+	      struct do_open_args args;
+	      args.shlib_name = __alloca (shlen);
+	      args.ni = ni;
 
 	      /* Construct shared object name.  */
-	      __stpcpy (__stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"),
+	      __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.shlib_name,
+						      "libnss_"),
 					    ni->library->name),
 				  ".so"),
 			__nss_shlib_revision);
 
-	      if (nss_dlerror_run (do_open) != 0)
+	      if (nss_dlerror_run (do_open, &args) != 0)
 		/* Failed to load the library.  */
 		ni->library->lib_handle = (void *) -1l;
 	    }
@@ -359,26 +393,19 @@ nss_lookup_function (service_user *ni, const char *fct_name)
 	      /* Get the desired function.  Again,  GNU ld.so magic ahead.  */
 	      size_t namlen = (5 + strlen (ni->library->name) + 1
 			       + strlen (fct_name) + 1);
-	      char name[namlen];
-	      struct link_map *map = ni->library->lib_handle;
-	      ElfW(Addr) loadbase;
-	      const ElfW(Sym) *ref = NULL;
-	      void get_sym (void)
-		{
-		  struct link_map *scope[2] = { map, NULL };
-		  loadbase = _dl_lookup_symbol (name, &ref,
-						scope, map->l_name, 0);
-		}
+	      struct get_sym_args args;
+	      args.name = __alloca (namlen);
+	      args.map = ni->library->lib_handle;
 
 	      /* Construct the function name.  */
-	      __stpcpy (__stpcpy (__stpcpy (__stpcpy (name, "_nss_"),
+	      __stpcpy (__stpcpy (__stpcpy (__stpcpy (args.name, "_nss_"),
 					    ni->library->name),
 				  "_"),
 			fct_name);
 
 	      /* Look up the symbol.  */
-	      result = (nss_dlerror_run (get_sym)
-			? NULL : (void *) (loadbase + ref->st_value));
+	      result = (nss_dlerror_run (get_sym, &args) ? NULL
+			: (void *) (args.loadbase + args.ref->st_value));
 	    }
 
 	  /* Remember function pointer for later calls.  Even if null, we