From ce85d65bae842fad22fa8e9cb4ad122daeef7831 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 19 Oct 1998 15:22:14 +0000 Subject: [PATCH] Update. 1998-10-19 Ulrich Drepper * include/ldsodefs.h: New file. * iconv/gconv.c: Include ldsodefs.h, not elf/ldsodefs.h. Remove change to avoid using _CALL_DL_FCT. * iconv/gconv_db.c: Likewise. * iconv/gconv_dl.c: Likewise. * iconv/skeleton.c: Likewise, here for DL_CALL_FCT. * malloc/mtrace.c: Include ldsodefs.h, not elf/ldsodefs.h. * nss/nsswitch.c: Likewise. * nss/nsswitch.h: Likewise. 1998-10-19 Philip Blundell * sunrpc/Makefile (otherlibs): If static NSS is in use, set to the required libraries. * login/Makefile (otherlibs): Likewise. * nscd/Makefile (otherlibs): Likewise. * Makeconfig (link-libc) [! build_shared]: Add $(otherlibs). * debug/Makefile (install-bin): Only build catchsegv if using ELF. * inet/Makefile: Add -DSTATIC_NSS to CFLAGS. 1998-10-19 Philip Blundell * sysdeps/unix/sysv/linux/arm/syscalls.list: Added setfsgid and setfsuid. 1998-10-19 Andreas Jaeger * nscd/connections.c: Fix typos in comments and strings. * nscd/nscd.conf: Update according to recent changes to nscd. * nscd/cache.c (prune_cache): Remove wrong comment. copy_posix.mask for copy instruction. --- ChangeLog | 40 ++++++++++++++++++++++++++++++- Makeconfig | 4 +++- debug/Makefile | 4 ++++ iconv/gconv.c | 13 +--------- iconv/gconv_db.c | 17 +------------ iconv/gconv_dl.c | 2 +- iconv/skeleton.c | 19 ++++----------- include/ldsodefs.h | 15 ++++++++++++ inet/Makefile | 4 ++++ login/Makefile | 5 ++++ malloc/mtrace.c | 4 +--- nscd/Makefile | 5 ++++ nscd/cache.c | 4 +--- nscd/connections.c | 6 ++--- nscd/nscd.conf | 4 +++- nss/nsswitch.c | 2 +- nss/nsswitch.h | 2 +- sunrpc/Makefile | 5 ++++ sysdeps/unix/sysv/linux/arm/syscalls.list | 6 +++-- 19 files changed, 101 insertions(+), 60 deletions(-) create mode 100644 include/ldsodefs.h diff --git a/ChangeLog b/ChangeLog index 726fee9..410a657 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +1998-10-19 Ulrich Drepper + + * include/ldsodefs.h: New file. + + * iconv/gconv.c: Include ldsodefs.h, not elf/ldsodefs.h. + Remove change to avoid using _CALL_DL_FCT. + * iconv/gconv_db.c: Likewise. + * iconv/gconv_dl.c: Likewise. + * iconv/skeleton.c: Likewise, here for DL_CALL_FCT. + * malloc/mtrace.c: Include ldsodefs.h, not elf/ldsodefs.h. + * nss/nsswitch.c: Likewise. + * nss/nsswitch.h: Likewise. + +1998-10-19 Philip Blundell + + * sunrpc/Makefile (otherlibs): If static NSS is in use, set to the + required libraries. + * login/Makefile (otherlibs): Likewise. + * nscd/Makefile (otherlibs): Likewise. + * Makeconfig (link-libc) [! build_shared]: Add $(otherlibs). + + * debug/Makefile (install-bin): Only build catchsegv if using ELF. + + * inet/Makefile: Add -DSTATIC_NSS to CFLAGS. + +1998-10-19 Philip Blundell + + * sysdeps/unix/sysv/linux/arm/syscalls.list: Added setfsgid + and setfsuid. + +1998-10-19 Andreas Jaeger + + * nscd/connections.c: Fix typos in comments and strings. + + * nscd/nscd.conf: Update according to recent changes to nscd. + + * nscd/cache.c (prune_cache): Remove wrong comment. + 1998-10-19 13:24 Ulrich Drepper * locale/programs/ld-collate.c (collate_startup): Clear bit for this @@ -14,7 +52,7 @@ (main): Before processing copy list add ©_posix to copy_list. * locale/programs/locales.h: Add definition of copy_def_list_t. * locale/programs/locfile.c: Clear bit for appropriate category in - case of an copy instruction. + copy_posix.mask for copy instruction. 1998-10-19 Ulrich Drepper diff --git a/Makeconfig b/Makeconfig index 18773ff..237f48f 100644 --- a/Makeconfig +++ b/Makeconfig @@ -417,7 +417,9 @@ $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$( elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf) dbobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)db2) else -link-libc = $(common-objpfx)libc.a $(gnulib) $(common-objpfx)libc.a +nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) +resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) +link-libc = $(common-objpfx)libc.a $(otherlibs) $(gnulib) $(common-objpfx)libc.a endif endif diff --git a/debug/Makefile b/debug/Makefile index 698ad07..e9f085c 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -36,8 +36,12 @@ extra-libs-others = $(extra-libs) libSegFault-routines = segfault libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes)) +include ../Makeconfig + distribute += catchsegv.sh +ifeq ($(elf),yes) install-bin = catchsegv +endif generated = catchsegv include ../Rules diff --git a/iconv/gconv.c b/iconv/gconv.c index ceefffc..cc61e03 100644 --- a/iconv/gconv.c +++ b/iconv/gconv.c @@ -23,9 +23,7 @@ #include #include -#ifndef STATIC_GCONV -# include -#endif +#include int internal_function @@ -43,12 +41,8 @@ __gconv (gconv_t cd, const char **inbuf, const char *inbufend, char **outbuf, if (inbuf == NULL || *inbuf == NULL) /* We just flush. */ -#ifdef _CALL_DL_FCT result = _CALL_DL_FCT (cd->steps->fct, (cd->steps, cd->data, NULL, NULL, converted, 1)); -#else - result = cd->steps->fct (cd->steps, cd->data, NULL, NULL, converted, 1); -#endif else { const char *last_start; @@ -60,14 +54,9 @@ __gconv (gconv_t cd, const char **inbuf, const char *inbufend, char **outbuf, do { last_start = *inbuf; -#ifdef _CALL_DL_FCT result = _CALL_DL_FCT (cd->steps->fct, (cd->steps, cd->data, inbuf, inbufend, converted, 0)); -#else - result = cd->steps->fct (cd->steps, cd->data, inbuf, inbufend, - converted, 0); -#endif } while (result == GCONV_EMPTY_INPUT && last_start != *inbuf && *inbuf + cd->steps->min_needed_from <= inbufend); diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c index cbaaf18..443e5bf 100644 --- a/iconv/gconv_db.c +++ b/iconv/gconv_db.c @@ -23,10 +23,7 @@ #include #include -#ifndef STATIC_GCONV -# include -#endif - +#include #include @@ -158,11 +155,7 @@ free_derivation (void *p) for (cnt = 0; cnt < deriv->nsteps; ++cnt) if (deriv->steps[cnt].end_fct) -#ifdef _CALL_DL_FCT _CALL_DL_FCT (deriv->steps[cnt].end_fct, (&deriv->steps[cnt])); -#else - deriv->steps[cnt].end_fct (&deriv->steps[cnt]); -#endif free ((struct gconv_step *) deriv->steps); free (deriv); @@ -228,11 +221,7 @@ gen_steps (struct derivation_step *best, const char *toset, /* Call the init function. */ if (result[step_cnt].init_fct != NULL) -#ifdef _CALL_DL_FCT _CALL_DL_FCT (result[step_cnt].init_fct, (&result[step_cnt])); -#else - result[step_cnt].init_fct (&result[step_cnt]); -#endif current = current->last; } @@ -243,11 +232,7 @@ gen_steps (struct derivation_step *best, const char *toset, while (++step_cnt < *nsteps) { if (result[step_cnt].end_fct != NULL) -#ifdef _CALL_DL_FCT _CALL_DL_FCT (result[step_cnt].end_fct, (&result[step_cnt])); -#else - result[step_cnt].end_fct (&result[step_cnt]); -#endif #ifndef STATIC_GCONV __gconv_release_shlib (result[step_cnt].shlib_handle); #endif diff --git a/iconv/gconv_dl.c b/iconv/gconv_dl.c index 1c04dee..7c64a91 100644 --- a/iconv/gconv_dl.c +++ b/iconv/gconv_dl.c @@ -24,9 +24,9 @@ #include #include #include -#include #include +#include #include diff --git a/iconv/skeleton.c b/iconv/skeleton.c index bae82be..b1e96eb 100644 --- a/iconv/skeleton.c +++ b/iconv/skeleton.c @@ -85,8 +85,8 @@ #ifndef STATIC_GCONV # include -# include #endif +#include /* The direction objects. */ @@ -222,15 +222,9 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, if (status == GCONV_OK) #endif - { - /* Give the modules below the same chance. */ -#ifdef DL_CALL_FCT - status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL, - written, 1)); -#else - status = (*fct) (next_step, next_data, NULL, NULL, written, 1); -#endif - } + /* Give the modules below the same chance. */ + status = DL_CALL_FCT (fct, (next_step, next_data, NULL, NULL, + written, 1)); } } else @@ -296,13 +290,8 @@ FUNCTION_NAME (struct gconv_step *step, struct gconv_step_data *data, const char *outerr = data->outbuf; int result; -#ifdef DL_CALL_FCT result = DL_CALL_FCT (fct, (next_step, next_data, &outerr, outbuf, written, 0)); -#else - result = (*fct) (next_step, next_data, &outerr, outbuf, - written, 0); -#endif if (result != GCONV_EMPTY_INPUT) { diff --git a/include/ldsodefs.h b/include/ldsodefs.h new file mode 100644 index 0000000..ffc7b3c --- /dev/null +++ b/include/ldsodefs.h @@ -0,0 +1,15 @@ +/* We must use the appropriate version for the system. */ +#ifdef __ELF__ +# include +#else +/* We have no dynamic loading. Define the macros we need here as dummy + versions. */ +# ifndef _LDSODEFS_H +# define _LDSODEFS_H 1 + +/* Call a function through a pointer. */ +# define _CALL_DL_FCT(fctp, args) (*fctp) args +# define CALL_DL_FCT(fctp, args) (*fctp) args + +# endif /* ldsodefs.h */ +#endif diff --git a/inet/Makefile b/inet/Makefile index d1b984a..d37cfc7 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -62,3 +62,7 @@ CFLAGS-gethstbynm_r.c = -DUSE_NSCD=1 CFLAGS-gethstbynm2_r.c = -DUSE_NSCD=1 endif + +ifeq ($(build-static-nss),yes) +CFLAGS += -DSTATIC_NSS +endif diff --git a/login/Makefile b/login/Makefile index f6dc62f..638421e 100644 --- a/login/Makefile +++ b/login/Makefile @@ -53,6 +53,11 @@ libutil-routines:= login login_tty logout logwtmp openpty forkpty include ../Rules +ifeq (yes,$(build-static-nss)) +otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ + $(resolvobjdir)/libresolv.a $(common-objpfx)libc.a +endif + # pt_chown needs to be setuid root. $(inst_libexecdir)/pt_chown: $(objpfx)pt_chown $(+force) $(make-target-directory) diff --git a/malloc/mtrace.c b/malloc/mtrace.c index ec551ff..57c9dff 100644 --- a/malloc/mtrace.c +++ b/malloc/mtrace.c @@ -28,9 +28,7 @@ #include #endif -#ifdef HAVE_ELF -#include -#endif +#include #include diff --git a/nscd/Makefile b/nscd/Makefile index 278bca6..d915aa7 100644 --- a/nscd/Makefile +++ b/nscd/Makefile @@ -38,6 +38,11 @@ extra-objs := $(nscd-modules:=.o) endif +ifeq (yes,$(build-static-nss)) +otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ + $(resolvobjdir)/libresolv.a +endif + distribute := nscd.h nscd-client.h dbg_log.h \ $(nscd-modules:=.c) TODO nscd.conf nscd.init \ nscd_proto.h diff --git a/nscd/cache.c b/nscd/cache.c index e957a57..4ab83db 100644 --- a/nscd/cache.c +++ b/nscd/cache.c @@ -118,9 +118,7 @@ cache_add (int type, void *key, size_t len, const void *packet, size_t total, must be invalidated and remember them. Then we get the lock and actually remove them. This is complicated by the way we have to free the data structures since some hash table entries share the same - data. - - This function must be called with the write-lock held. */ + data. */ void prune_cache (struct database *table, time_t now) { diff --git a/nscd/connections.c b/nscd/connections.c index 5ef13bf..591e300 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -197,7 +197,7 @@ static void handle_request (int fd, request_header *req, void *key) { if (debug_level > 0) - dbg_log (_("handle_requests: request received (Version = %d)"), + dbg_log (_("handle_request: request received (Version = %d)"), req->version); if (req->version != NSCD_VERSION) @@ -219,7 +219,7 @@ cannot handle old request version %d; current version is %d"), /* Is this service enabled? */ if (!db->enabled) { - /* No sent the prepared record. */ + /* No, sent the prepared record. */ if (TEMP_FAILURE_RETRY (write (fd, db->disabled_iov->iov_base, db->disabled_iov->iov_len)) != db->disabled_iov->iov_len) @@ -372,7 +372,7 @@ nscd_run (void *p) to 1kb. */ if (req.key_len < 0 || req.key_len > 1024) { - dbg_log (_("key length in request to long: %Zd"), req.key_len); + dbg_log (_("key length in request too long: %Zd"), req.key_len); close (fd); continue; } diff --git a/nscd/nscd.conf b/nscd/nscd.conf index 5e327e8..d2b53a7 100644 --- a/nscd/nscd.conf +++ b/nscd/nscd.conf @@ -7,6 +7,7 @@ # # logfile # debug-level +# threads <#threads to use> # # enable-cache # positive-time-to-live