From 7cc27f440c2f709fda63af7ecb3747deeeb799f0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 10 Feb 1997 03:19:57 +0000 Subject: update from main archive 970209 1997-02-09 02:59 Ulrich Drepper * version.h (VERSION): Bump to 2.0.2. * posix/Makefile (routines): Add getopt_init. * posix/getopt.c: Don't get environment variable with nonoption flags here. Depend on __getopt_nonoption_flags variable filled somewhere else. This is necessary since the variable must be removed even when getopt isn't used in case exec(2) gets called. * posix/getopt_init.c: New file. Initialize __getopt_nonoption_flags and remove environment variable. * sysdeps/i386/init-first.c: Call __getopt_clean_environment. * sysdeps/mach/hurd/i386/init-first.c: Likewise. * sysdeps/stub/init-first.c: Likewise. * sysdeps/unix/sysv/linux/init-first.c: Likewise. * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Recognize AT_PAGESZ entry in auxiliary vector and store value in _dl_pagesize. * sysdeps/generic/crypt-entry.h: Return EOPNOTSUPP when DES encryption is wanted. * libio/vsnprintf.c: If MAXLEN is 0 return 0. * stdio/vsnprintf.c: Likewise. Reported by Philip Blundell . 1997-02-07 17:43 Ulrich Drepper * sysdeps/generic/sysd-stdio.c: Include . Change PTR to void *. * sysdeps/posix/vdprintf.c: Change PTR to void *. Reported by Brian Oxley . 1997-02-07 17:41 Philip Blundell * sysdeps/unix/sysv/linux/socketbits.h: Fix typo. 1997-02-06 13:49 Andreas Schwab * rellns-sh: No need to check for existance of first parameter. 1997-02-06 14:50 Andreas Schwab * sysdeps/posix/getcwd.c (__getcwd): Fix resource leaks. Reported by David Holland . 1997-02-06 14:38 Andreas Schwab * sunrpc/clnt_tcp.c (readtcp): Pass copy of timeout value to select, in case it is modified by the latter. * sunrpc/clnt_udp.c (clntudp_call): Likewise. * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. * sunrpc/svc_tcp.c (readtcp): Likewise. * sunrpc/svc_authux.c (_svcauth_unix): Fix type of area_gids array. * sunrpc/authuxprot.c (xdr_authunix_parms): Check size of uid_t and gid_t. * sunrpc/auth_unix.c (authunix_validate): Fix type of second argument. 1997-02-06 14:29 Andreas Schwab * elf/Makefile (extra-objs): Don't zap previous value. * Makefile (before-compile): Likewise. Don't add gnu/lib-names.h twice. 1997-02-06 14:19 Andreas Schwab * sysdeps/unix/sysv/linux/m68k/brk.c: Add workaround for braindamage (sigh!). 1997-02-06 17:10 Jim Meyering * manual/memory.texi: Correct `copystring' example for obstacks. 1997-02-06 14:10 Ulrich Drepper * Makeconfig: Don't use [:lower:] and [:upper:] in tr since old GNU tr don't grok it. 1997-02-03 21:13 Andreas Schwab * sysdeps/unix/sysv/linux/socketbits.h [__GNUC__<2] (struct cmsghdr): Don't use GNU C extensions. (CMSG_DATA): Use portable definition. 1997-02-05 05:58 Ulrich Drepper * elf/ldd.bash.in: Add test for read permission and print appropriate message. Change warning and error messages to print "ldd: " at start. * elf/ldd.sh.in: Likewise. * stdlib/Makefile (routines): Add atoll. * stdlib/atoll.c: New file. * stdlib/stdlib.h: Add prototype and optimization for atoll. * stdlib/a64l.c: Update copyright. * stdlib/abs.c: Likewise. * stdlib/atof.c: Likewise. * stdlib/atoi.c: Likewise. * stdlib/atol.c: Likewise. * stdlib/bsearch.c: Likewise. * stdlib/exit.c: Likewise. * stdlib/fpioconst.c: Likewise. * stdlib/fpioconst.h: Likewise. * stdlib/jrand48.c: Likewise. * stdlib/jrand48_r.c: Likewise. * stdlib/labs.c: Likewise. * stdlib/lcong48.c: Likewise. * stdlib/lcong48_r.c: Likewise. * stdlib/llabs.c: Likewise. * stdlib/lrand48.c: Likewise. * stdlib/lrand48_r.c: Likewise. * stdlib/mblen.c: Likewise. * stdlib/mbstowcs.c: Likewise. * stdlib/mbtowc.c: Likewise. * stdlib/mp_clz_tab.c: Likewise. * stdlib/mrand48.c: Likewise. * stdlib/mrand48_r.c: Likewise. * stdlib/msort.c: Likewise. * stdlib/nrand48.c: Likewise. * stdlib/nrand48_r.c: Likewise. * stdlib/qsort.c: Likewise. * stdlib/rpmatch.c: Likewise. * stdlib/seed48.c: Likewise. * stdlib/seed48_r.c: Likewise. * stdlib/srand48.c: Likewise. * stdlib/srand48_r.c: Likewise. * stdlib/strtod.c: Likewise. * stdlib/wcstombs.c: Likewise. * stdlib/wctomb.c: Likewise. 1997-02-05 05:08 Ulrich Drepper * stdlib/mp_clz_tab.c (__clz_tab): Follow change in GMP and define as const. 1997-02-04 23:57 Fila Kolodny * sysdeps/unix/sysv/linux/socketbits.h: Define __need_NULL before including . 1997-02-03 20:01 H.J. Lu * time/Makefile (tzbases, tzlinks): New. (tzfiles): Changed to $(tzbases) $(tzlinks). ($(tzfiles:%=$(objpfx)z.%): Make $(tzlinks) depend on $(tzbases). 1997-02-02 12:13 H.J. Lu * Makefile (install): Ignore error from ldconfig. * time/zic.c (mkdirs): Double check the error return of mkdir (). 1997-02-04 22:01 Ulrich Drepper * stdio-common/vfprintf.c: Prepare to use __va_copy for architectures like PPC where va_list is no integral type. 1997-02-04 15:27 Roma Ekzhanov * posix/getopt.c (exchange): Don't allocate nonoption_flags array if nonoption_flags_len == -1. --- .cvsignore | 6 +- ChangeLog | 167 +++++++++++++++++++++++++++++++++++ Makeconfig | 3 +- Makefile | 6 +- Makerules | 2 +- elf/Makefile | 2 +- elf/ldd.bash.in | 32 ++++--- elf/ldd.sh.in | 34 ++++--- libio/vsnprintf.c | 5 ++ manual/memory.texi | 6 +- po/libc.pot | 26 +++--- posix/Makefile | 4 +- posix/getopt.c | 57 ++++++------ rellns-sh | 6 -- stdio-common/vfprintf.c | 14 ++- stdio/vsnprintf.c | 35 ++++---- stdlib/Makefile | 4 +- stdlib/a64l.c | 30 +++---- stdlib/abs.c | 33 ++++--- stdlib/atof.c | 33 ++++--- stdlib/atoi.c | 33 ++++--- stdlib/atol.c | 33 ++++--- stdlib/bsearch.c | 49 +++++----- stdlib/exit.c | 28 +++--- stdlib/fpioconst.c | 28 +++--- stdlib/fpioconst.h | 34 +++---- stdlib/jrand48.c | 36 ++++---- stdlib/jrand48_r.c | 36 ++++---- stdlib/labs.c | 33 ++++--- stdlib/lcong48.c | 30 +++---- stdlib/lcong48_r.c | 30 +++---- stdlib/llabs.c | 28 +++--- stdlib/lrand48.c | 36 ++++---- stdlib/lrand48_r.c | 30 +++---- stdlib/mblen.c | 33 ++++--- stdlib/mbstowcs.c | 34 +++---- stdlib/mbtowc.c | 34 +++---- stdlib/mp_clz_tab.c | 33 ++++--- stdlib/mrand48.c | 36 ++++---- stdlib/mrand48_r.c | 30 +++---- stdlib/msort.c | 29 +++--- stdlib/nrand48.c | 36 ++++---- stdlib/nrand48_r.c | 30 +++---- stdlib/qsort.c | 47 +++++----- stdlib/rpmatch.c | 39 ++++---- stdlib/seed48.c | 30 +++---- stdlib/seed48_r.c | 30 +++---- stdlib/srand48.c | 30 +++---- stdlib/srand48_r.c | 30 +++---- stdlib/stdlib.h | 12 +++ stdlib/strtod.c | 37 ++++---- stdlib/wcstombs.c | 34 +++---- stdlib/wctomb.c | 34 +++---- sunrpc/auth_unix.c | 7 +- sunrpc/authuxprot.c | 25 +++--- sunrpc/clnt_tcp.c | 3 +- sunrpc/clnt_udp.c | 3 +- sunrpc/pmap_rmt.c | 5 +- sunrpc/svc_authux.c | 14 +-- sunrpc/svc_tcp.c | 3 +- sysdeps/generic/crypt-entry.c | 6 +- sysdeps/generic/dl-sysdep.c | 4 + sysdeps/generic/sysd-stdio.c | 3 +- sysdeps/i386/init-first.c | 4 + sysdeps/mach/hurd/i386/init-first.c | 36 +++++--- sysdeps/posix/getcwd.c | 7 +- sysdeps/posix/vdprintf.c | 32 +++---- sysdeps/stub/init-first.c | 32 ++++--- sysdeps/unix/sysv/linux/init-first.c | 10 ++- sysdeps/unix/sysv/linux/m68k/brk.c | 35 ++++---- sysdeps/unix/sysv/linux/socketbits.h | 11 ++- time/Makefile | 16 +++- time/zic.c | 17 ++-- version.h | 2 +- 74 files changed, 1061 insertions(+), 801 deletions(-) diff --git a/.cvsignore b/.cvsignore index e688e76a03..606e7270bd 100644 --- a/.cvsignore +++ b/.cvsignore @@ -4,7 +4,7 @@ TODO COPYING* AUTHORS copyr-* copying.* glibc-* -configparms +configparms sun[43]* i[345]86* hp300* @@ -13,3 +13,7 @@ ieeetest hppa-sysdeps regex gpl2lgpl.sed distinfo distinfo + +crypt +linuxthreads +localedata diff --git a/ChangeLog b/ChangeLog index caf6ddbded..2b2e5d14a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,170 @@ +1997-02-09 02:59 Ulrich Drepper + + * version.h (VERSION): Bump to 2.0.2. + + * posix/Makefile (routines): Add getopt_init. + * posix/getopt.c: Don't get environment variable with nonoption + flags here. Depend on __getopt_nonoption_flags variable filled + somewhere else. This is necessary since the variable must be + removed even when getopt isn't used in case exec(2) gets called. + * posix/getopt_init.c: New file. Initialize __getopt_nonoption_flags + and remove environment variable. + * sysdeps/i386/init-first.c: Call __getopt_clean_environment. + * sysdeps/mach/hurd/i386/init-first.c: Likewise. + * sysdeps/stub/init-first.c: Likewise. + * sysdeps/unix/sysv/linux/init-first.c: Likewise. + + * sysdeps/generic/dl-sysdep.c (_dl_sysdep_start): Recognize + AT_PAGESZ entry in auxiliary vector and store value in _dl_pagesize. + + * sysdeps/generic/crypt-entry.h: Return EOPNOTSUPP when DES + encryption is wanted. + + * libio/vsnprintf.c: If MAXLEN is 0 return 0. + * stdio/vsnprintf.c: Likewise. + Reported by Philip Blundell . + +1997-02-07 17:43 Ulrich Drepper + + * sysdeps/generic/sysd-stdio.c: Include . + Change PTR to void *. + * sysdeps/posix/vdprintf.c: Change PTR to void *. + Reported by Brian Oxley . + +1997-02-07 17:41 Philip Blundell + + * sysdeps/unix/sysv/linux/socketbits.h: Fix typo. + +1997-02-06 13:49 Andreas Schwab + + * rellns-sh: No need to check for existance of first parameter. + +1997-02-06 14:50 Andreas Schwab + + * sysdeps/posix/getcwd.c (__getcwd): Fix resource leaks. Reported + by David Holland . + +1997-02-06 14:38 Andreas Schwab + + * sunrpc/clnt_tcp.c (readtcp): Pass copy of timeout value to + select, in case it is modified by the latter. + * sunrpc/clnt_udp.c (clntudp_call): Likewise. + * sunrpc/pmap_rmt.c (clnt_broadcast): Likewise. + * sunrpc/svc_tcp.c (readtcp): Likewise. + + * sunrpc/svc_authux.c (_svcauth_unix): Fix type of area_gids + array. + + * sunrpc/authuxprot.c (xdr_authunix_parms): Check size of uid_t + and gid_t. + + * sunrpc/auth_unix.c (authunix_validate): Fix type of second + argument. + +1997-02-06 14:29 Andreas Schwab + + * elf/Makefile (extra-objs): Don't zap previous value. + * Makefile (before-compile): Likewise. Don't add gnu/lib-names.h + twice. + +1997-02-06 14:19 Andreas Schwab + + * sysdeps/unix/sysv/linux/m68k/brk.c: Add workaround for + braindamage (sigh!). + +1997-02-06 17:10 Jim Meyering + + * manual/memory.texi: Correct `copystring' example for obstacks. + +1997-02-06 14:10 Ulrich Drepper + + * Makeconfig: Don't use [:lower:] and [:upper:] in tr since old + GNU tr don't grok it. + +1997-02-03 21:13 Andreas Schwab + + * sysdeps/unix/sysv/linux/socketbits.h [__GNUC__<2] (struct cmsghdr): + Don't use GNU C extensions. + (CMSG_DATA): Use portable definition. + +1997-02-05 05:58 Ulrich Drepper + + * elf/ldd.bash.in: Add test for read permission and print appropriate + message. Change warning and error messages to print "ldd: " at start. + * elf/ldd.sh.in: Likewise. + + * stdlib/Makefile (routines): Add atoll. + * stdlib/atoll.c: New file. + * stdlib/stdlib.h: Add prototype and optimization for atoll. + + * stdlib/a64l.c: Update copyright. + * stdlib/abs.c: Likewise. + * stdlib/atof.c: Likewise. + * stdlib/atoi.c: Likewise. + * stdlib/atol.c: Likewise. + * stdlib/bsearch.c: Likewise. + * stdlib/exit.c: Likewise. + * stdlib/fpioconst.c: Likewise. + * stdlib/fpioconst.h: Likewise. + * stdlib/jrand48.c: Likewise. + * stdlib/jrand48_r.c: Likewise. + * stdlib/labs.c: Likewise. + * stdlib/lcong48.c: Likewise. + * stdlib/lcong48_r.c: Likewise. + * stdlib/llabs.c: Likewise. + * stdlib/lrand48.c: Likewise. + * stdlib/lrand48_r.c: Likewise. + * stdlib/mblen.c: Likewise. + * stdlib/mbstowcs.c: Likewise. + * stdlib/mbtowc.c: Likewise. + * stdlib/mp_clz_tab.c: Likewise. + * stdlib/mrand48.c: Likewise. + * stdlib/mrand48_r.c: Likewise. + * stdlib/msort.c: Likewise. + * stdlib/nrand48.c: Likewise. + * stdlib/nrand48_r.c: Likewise. + * stdlib/qsort.c: Likewise. + * stdlib/rpmatch.c: Likewise. + * stdlib/seed48.c: Likewise. + * stdlib/seed48_r.c: Likewise. + * stdlib/srand48.c: Likewise. + * stdlib/srand48_r.c: Likewise. + * stdlib/strtod.c: Likewise. + * stdlib/wcstombs.c: Likewise. + * stdlib/wctomb.c: Likewise. + +1997-02-05 05:08 Ulrich Drepper + + * stdlib/mp_clz_tab.c (__clz_tab): Follow change in GMP and define + as const. + +1997-02-04 23:57 Fila Kolodny + + * sysdeps/unix/sysv/linux/socketbits.h: Define __need_NULL before + including . + +1997-02-03 20:01 H.J. Lu + + * time/Makefile (tzbases, tzlinks): New. + (tzfiles): Changed to $(tzbases) $(tzlinks). + ($(tzfiles:%=$(objpfx)z.%): Make $(tzlinks) depend on $(tzbases). + +1997-02-02 12:13 H.J. Lu + + * Makefile (install): Ignore error from ldconfig. + + * time/zic.c (mkdirs): Double check the error return of mkdir (). + +1997-02-04 22:01 Ulrich Drepper + + * stdio-common/vfprintf.c: Prepare to use __va_copy for architectures + like PPC where va_list is no integral type. + +1997-02-04 15:27 Roma Ekzhanov + + * posix/getopt.c (exchange): Don't allocate nonoption_flags array + if nonoption_flags_len == -1. + 1997-02-04 02:08 Ulrich Drepper * Version 2.0.1 net release. diff --git a/Makeconfig b/Makeconfig index 74f8d795a4..fbe2ab11fb 100644 --- a/Makeconfig +++ b/Makeconfig @@ -582,7 +582,8 @@ $(common-objpfx)gnu/lib-names.stmp: $(common-objpfx)soversions.mk (libs='$(all-sonames)';\ for l in $$libs; do \ upname=`echo $$l | sed 's/[.]so.*//' | \ - tr '[:lower:]-' '[:upper:]_'`; \ + tr 'abcdefghijklmnopqrstuvwxyz-' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`; \ echo "#define $${upname}_SO \"$$l\""; \ done;) | sort; \ echo; \ diff --git a/Makefile b/Makefile index f2d796f19b..84d2ff999d 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \ headers := errno.h sys/errno.h errnos.h limits.h values.h \ features.h gnu-versions.h libc-lock.h xopen_lim.h aux = sysdep $(libc-init) version -before-compile = $(objpfx)version-info.h +before-compile += $(objpfx)version-info.h echo-headers: subdir_echo-headers @@ -94,7 +94,6 @@ install-others = $(inst_includedir)/gnu/stubs.h install-bin = glibcbug ifeq (yes,$(build-shared)) -before-compile += $(objpfx)gnu/lib-names.h install-others += $(inst_includedir)/gnu/lib-names.h endif @@ -115,10 +114,11 @@ include Makerules install: subdir_install # Create linkfs for shared libraries using the `ldconfig' program is possible. +# Ignore the error if we cannot update /etc/ld.so.cache. ifeq (no,$(cross-compiling)) ifeq (yes,$(build-shared)) install: - test ! -x $(common-objpfx)elf/ldconfig || \ + -test ! -x $(common-objpfx)elf/ldconfig || \ $(common-objpfx)elf/ldconfig -d $(inst_slibdir) $(inst_libdir) endif endif diff --git a/Makerules b/Makerules index 881d58434e..23fa219102 100644 --- a/Makerules +++ b/Makerules @@ -810,7 +810,7 @@ $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=$(..)%) -o $(..)$(@F) endef # We always want to use configuration definitions. -BUILD_CFLAGS = -include $(..)config.h +BUILD_CFLAGS = -include $(common-objpfx)config.h # Support the GNU standard name for this target. .PHONY: check diff --git a/elf/Makefile b/elf/Makefile index 55094e3939..4666919478 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -56,7 +56,7 @@ install-bin = ldd endif ifeq (yes,$(has-ldconfig)) -extra-objs = ldconfig.o +extra-objs += ldconfig.o install-rootsbin = ldconfig $(objpfx)ldconfig: $(objpfx)ldconfig.o diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in index d174709380..d4ea3310fd 100644 --- a/elf/ldd.bash.in +++ b/elf/ldd.bash.in @@ -79,17 +79,20 @@ case $# in *) file="./$1" ;; esac if test ! -f "$file"; then - echo "${file}:" $"no such file" + echo "ldd: ${file}:" $"no such file" exit 1 - else + elif test -r "$file"; then test -x "$file" || - echo $"warning: you do not have execution permission for" "\`$file'" - if ${RTLD} --verify "$file"; then - LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1 - else - echo $" not a dynamic executable" - exit 1 - fi + echo $"ldd: warning: you do not have execution permission for" "\`$file'" + if ${RTLD} --verify "$file"; then + LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1 + else + echo $" not a dynamic executable" + exit 1 + fi + else + echo $"ldd: error: you do not have read permission for" "\`$file'" + exit 1 fi exit ;; *) @@ -102,17 +105,20 @@ case $# in *) file="./$file" ;; esac if test ! -f "$file"; then - echo "${file}:" $"no such file" + echo "ldd: ${file}:" $"no such file" result=1 - else - test -x "$file" || - echo $"warning: you do not have execution permission for" "\`$file'" + elif test -r "$file"; then + test -x "$file" || echo $"\ +ldd: warning: you do not have execution permission for" "\`$file'" if ${RTLD} --verify "$file"; then LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1 else echo $" not a dynamic executable" result=1 fi + else + echo $"ldd: error: you do not have read permission for" "\`$file'" + result=1 fi done esac diff --git a/elf/ldd.sh.in b/elf/ldd.sh.in index 4351578b6d..f7c1163890 100644 --- a/elf/ldd.sh.in +++ b/elf/ldd.sh.in @@ -77,15 +77,20 @@ Try \`ldd --help' for more information." *) file="./$1" ;; esac if test ! -f "$file"; then - echo "${file}: no such file" + echo "ldd: ${file}: no such file" exit 1 else - test -x "$file" || - echo "warning: you do not have execution permission for \`$file'" - if ${RTLD} --verify "$file"; then - LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1 + if test -r "$file"; then + test -x "$file" || + echo "ldd: warning: you do not have execution permission for \`$file'" + if ${RTLD} --verify "$file"; then + LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1 + else + echo ' not a dynamic executable' + exit 1 + fi else - echo ' not a dynamic executable' + echo "ldd: error: you do not have read permission for \`$file'" exit 1 fi fi @@ -100,15 +105,20 @@ Try \`ldd --help' for more information." *) file="./$file" ;; esac if test ! -f "$file"; then - echo "${file}: no such file" + echo "ldd: ${file}: no such file" result=1 else - test -x "$file" || - echo "warning: you do not have execution permission for \`$file'" - if ${RTLD} --verify "$file"; then - LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1 + if test -r "$file"; then + test -x "$file" || echo "\ +ldd: warning: you do not have execution permission for \`$file'" + if ${RTLD} --verify "$file"; then + LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1 + else + echo ' not a dynamic executable' + result=1 + fi else - echo ' not a dynamic executable' + echo "ldd: error: you do not have read permission for \`$file'" result=1 fi fi diff --git a/libio/vsnprintf.c b/libio/vsnprintf.c index 9ec06914c0..af901bf3e6 100644 --- a/libio/vsnprintf.c +++ b/libio/vsnprintf.c @@ -38,6 +38,11 @@ _IO_vsnprintf (string, maxlen, format, args) _IO_lock_t lock; sf._sbf._f._lock = &lock; #endif + + /* We need to handle the special case where MAXLEN is 0. */ + if (maxlen == 0) + return 0; + _IO_init ((_IO_FILE *) &sf, 0); _IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps; _IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string); diff --git a/manual/memory.texi b/manual/memory.texi index bd1a9a5401..9ebe31e920 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -905,9 +905,9 @@ struct obstack string_obstack; char * copystring (char *string) @{ - char *s = (char *) obstack_alloc (&string_obstack, - strlen (string) + 1); - memcpy (s, string, strlen (string)); + size_t len = strlen (string) + 1; + char *s = (char *) obstack_alloc (&string_obstack, len); + memcpy (s, string, len); return s; @} @end smallexample diff --git a/po/libc.pot b/po/libc.pot index e38500c191..dfaea8a48b 100644 --- a/po/libc.pot +++ b/po/libc.pot @@ -5,8 +5,8 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: libc 2.0\n" -"POT-Creation-Date: 1997-01-26 15:14+0100\n" +"Project-Id-Version: libc 2.0.1\n" +"POT-Creation-Date: 1997-02-04 16:58+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+DIST\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -178,47 +178,47 @@ msgstr "" msgid "%s: error in state machine" msgstr "" -#: posix/getopt.c:733 +#: posix/getopt.c:788 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" -#: posix/getopt.c:736 +#: posix/getopt.c:791 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" -#: posix/getopt.c:657 +#: posix/getopt.c:712 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:628 +#: posix/getopt.c:683 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" -#: posix/getopt.c:674 posix/getopt.c:847 +#: posix/getopt.c:729 posix/getopt.c:902 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" -#: posix/getopt.c:652 +#: posix/getopt.c:707 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:831 +#: posix/getopt.c:886 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" -#: posix/getopt.c:813 +#: posix/getopt.c:868 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" -#: posix/getopt.c:766 posix/getopt.c:896 +#: posix/getopt.c:821 posix/getopt.c:951 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" @@ -233,12 +233,12 @@ msgstr "" msgid "%s: premature end of file" msgstr "" -#: posix/getopt.c:707 +#: posix/getopt.c:762 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" -#: posix/getopt.c:703 +#: posix/getopt.c:758 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" diff --git a/posix/Makefile b/posix/Makefile index 1a2f6ae798..565561c57a 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -43,7 +43,7 @@ routines := \ pathconf sysconf fpathconf \ glob fnmatch regex \ confstr \ - getopt getopt1 \ + getopt getopt1 getopt_init \ sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax \ sched_primin sched_rr_gi \ getaddrinfo diff --git a/posix/getopt.c b/posix/getopt.c index 78021bb977..aa0c01ce59 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -253,37 +253,39 @@ static int last_nonopt; /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ -static char *nonoption_flags; +char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; static int original_argc; static char *const *original_argv; +extern pid_t __libc_pid; + /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ -static void store_args (int argc, char *const *argv) __attribute__ ((unused)); static void -store_args (int argc, char *const *argv) +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } -text_set_element (__libc_subinit, store_args); +text_set_element (__libc_subinit, store_args_and_env); # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ - char __tmp = nonoption_flags[ch1]; \ - nonoption_flags[ch1] = nonoption_flags[ch2]; \ - nonoption_flags[ch2] = __tmp; \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ } -#else +#else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) -#endif +#endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) @@ -313,10 +315,10 @@ exchange (argv) but it consists of two parts that need to be swapped next. */ #ifdef _LIBC - /* First make sure the handling of the `nonoption_flags' string can - work normally. Our top argument must be in the range of the - string. */ - if (nonoption_flags_len != 0 && top >= nonoption_flags_max_len) + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ @@ -325,11 +327,11 @@ exchange (argv) nonoption_flags_len = nonoption_flags_max_len = 0; else { - memcpy (new_str, nonoption_flags, nonoption_flags_max_len); + memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len); memset (&new_str[nonoption_flags_max_len], '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; - nonoption_flags = new_str; + __getopt_nonoption_flags = new_str; } } #endif @@ -420,36 +422,29 @@ _getopt_initialize (argc, argv, optstring) if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - if (nonoption_flags_max_len == 0) { - char var[100]; - const char *orig_str; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - orig_str = getenv (var); - if (orig_str == NULL || orig_str[0] == '\0') + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { + const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; - nonoption_flags = (char *) malloc (nonoption_flags_max_len); - if (nonoption_flags == NULL) + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else { - memcpy (nonoption_flags, orig_str, len); - memset (&nonoption_flags[len], '\0', + memcpy (__getopt_nonoption_flags, orig_str, len); + memset (&__getopt_nonoption_flags[len], '\0', nonoption_flags_max_len - len); } } } - nonoption_flags_len = nonoption_flags_max_len; } else @@ -540,7 +535,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) #ifdef _LIBC #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) + && __getopt_nonoption_flags[optind] == '1')) #else #define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif diff --git a/rellns-sh b/rellns-sh index 61f18c4146..5ce265bccf 100755 --- a/rellns-sh +++ b/rellns-sh @@ -22,12 +22,6 @@ if test $# -ne 2; then exit 1 fi -# We only handle the case where SOURCE is the name of an existing file -if test ! -f $1; then - echo "rellns: $1 must name an existing file" >&2 - exit 1 -fi - case $1 in /*) # Make both paths absolute. diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index d24c917bc2..eda0d7bd8e 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. +/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -880,7 +880,13 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* Initialize local variables. */ done = 0; grouping = (const char *) -1; +#ifdef __va_copy + /* This macro will be available soon in gcc's . Me need it + since on some systems `va_list' is not an integral type. */ + __va_copy (ap_save, ap); +#else ap_save = ap; +#endif nspecs_done = 0; /* Find the first format specifier. */ @@ -1203,12 +1209,12 @@ do_positional: /* Now we know all the types and the order. Fill in the argument values. */ - for (cnt = 0, ap = ap_save; cnt < nargs; ++cnt) + for (cnt = 0; cnt < nargs; ++cnt) switch (args_type[cnt]) { #define T(tag, mem, type) \ case tag: \ - args_value[cnt].mem = va_arg (ap, type); \ + args_value[cnt].mem = va_arg (ap_save, type); \ break T (PA_CHAR, pa_char, int); /* Promoted. */ @@ -1226,7 +1232,7 @@ do_positional: #undef T default: if ((args_type[cnt] & PA_FLAG_PTR) != 0) - args_value[cnt].pa_pointer = va_arg (ap, void *); + args_value[cnt].pa_pointer = va_arg (ap_save, void *); else args_value[cnt].pa_long_double = 0.0; break; diff --git a/stdio/vsnprintf.c b/stdio/vsnprintf.c index 5de157dc44..ddb1dfc9c0 100644 --- a/stdio/vsnprintf.c +++ b/stdio/vsnprintf.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1992, 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #include #include @@ -33,7 +32,11 @@ __vsnprintf (char *s, size_t maxlen, const char *format, va_list arg) int done; FILE f; - memset((PTR) &f, 0, sizeof(f)); + /* We have to handle the case of MAXLEN == 0 special. */ + if (maxlen == 0) + return 0; + + memset((void *) &f, 0, sizeof(f)); f.__magic = _IOMAGIC; f.__mode.__write = 1; /* The buffer size is one less than MAXLEN diff --git a/stdlib/Makefile b/stdlib/Makefile index 6e7b753180..35c0f0254a 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc. +# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -24,7 +24,7 @@ subdir := stdlib headers := stdlib.h alloca.h monetary.h routines := \ - atof atoi atol \ + atof atoi atol atoll \ abort \ bsearch qsort msort \ getenv putenv setenv secure-getenv \ diff --git a/stdlib/a64l.c b/stdlib/a64l.c index 3fdaab513b..11ecd6a054 100644 --- a/stdlib/a64l.c +++ b/stdlib/a64l.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/stdlib/abs.c b/stdlib/abs.c index 01cb7b331c..54de8063de 100644 --- a/stdlib/abs.c +++ b/stdlib/abs.c @@ -1,29 +1,28 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #undef abs /* Return the absolute value of I. */ int -DEFUN(abs, (i), int i) +abs (int i) { - return(i < 0 ? -i : i); + return i < 0 ? -i : i; } diff --git a/stdlib/atof.c b/stdlib/atof.c index 79585464d1..947278bf41 100644 --- a/stdlib/atof.c +++ b/stdlib/atof.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #undef atof @@ -24,7 +23,7 @@ Cambridge, MA 02139, USA. */ /* Convert a string to a double. */ double -DEFUN(atof, (nptr), CONST char *nptr) +atof (const char *nptr) { - return(strtod(nptr, (char **) NULL)); + return strtod (nptr, (char **) NULL); } diff --git a/stdlib/atoi.c b/stdlib/atoi.c index 9fe280cc3e..dbf524b225 100644 --- a/stdlib/atoi.c +++ b/stdlib/atoi.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #undef atoi @@ -24,7 +23,7 @@ Cambridge, MA 02139, USA. */ /* Convert a string to an int. */ int -DEFUN(atoi, (nptr), CONST char *nptr) +atoi (const char *nptr) { - return((int) strtol(nptr, (char **) NULL, 10)); + return (int) strtol (nptr, (char **) NULL, 10); } diff --git a/stdlib/atol.c b/stdlib/atol.c index 75f599c107..87fbd0909d 100644 --- a/stdlib/atol.c +++ b/stdlib/atol.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #undef atol @@ -24,7 +23,7 @@ Cambridge, MA 02139, USA. */ /* Convert a string to a long int. */ long int -DEFUN(atol, (nptr), CONST char *nptr) +atol (const char *nptr) { - return(strtol(nptr, (char **) NULL, 10)); + return strtol (nptr, (char **) NULL, 10); } diff --git a/stdlib/bsearch.c b/stdlib/bsearch.c index d798eabd2b..84af9d655c 100644 --- a/stdlib/bsearch.c +++ b/stdlib/bsearch.c @@ -1,50 +1,47 @@ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include /* Perform a binary search for KEY in BASE which has NMEMB elements of SIZE bytes each. The comparisons are done by (*COMPAR)(). */ -PTR -DEFUN(bsearch, (key, base, nmemb, size, compar), - register CONST PTR key AND register CONST PTR base AND - size_t nmemb AND register size_t size AND - register int EXFUN((*compar), (CONST PTR, CONST PTR))) +void * +bsearch (const void *key, const void *base, size_t nmemb, size_t size, + int (*compar) __P ((const void *, const void *))) { - register size_t l, u, idx; - register CONST PTR p; - register int comparison; + size_t l, u, idx; + const void *p; + int comparison; l = 0; u = nmemb; while (l < u) { idx = (l + u) / 2; - p = (PTR) (((CONST char *) base) + (idx * size)); - comparison = (*compar)(key, p); + p = (void *) (((const char *) base) + (idx * size)); + comparison = (*compar) (key, p); if (comparison < 0) u = idx; else if (comparison > 0) l = idx + 1; else - return (PTR) p; + return (void *) p; } return NULL; diff --git a/stdlib/exit.c b/stdlib/exit.c index ec7ee6a2db..b5b85aa26e 100644 --- a/stdlib/exit.c +++ b/stdlib/exit.c @@ -1,20 +1,20 @@ -/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include #include diff --git a/stdlib/fpioconst.c b/stdlib/fpioconst.c index 92eae7de90..d8c5fda956 100644 --- a/stdlib/fpioconst.c +++ b/stdlib/fpioconst.c @@ -1,21 +1,21 @@ /* Table of MP integer constants 10^(2^i), used for floating point <-> decimal. -Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include "fpioconst.h" #include /* This defines BITS_PER_MP_LIMB. */ diff --git a/stdlib/fpioconst.h b/stdlib/fpioconst.h index 110fc8b86a..35c7c6f02b 100644 --- a/stdlib/fpioconst.h +++ b/stdlib/fpioconst.h @@ -1,21 +1,21 @@ /* Header file for constants used in floating point <-> decimal conversions. -Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _FPIOCONST_H #define _FPIOCONST_H diff --git a/stdlib/jrand48.c b/stdlib/jrand48.c index 6a02a8606f..3da25166d7 100644 --- a/stdlib/jrand48.c +++ b/stdlib/jrand48.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/stdlib/jrand48_r.c b/stdlib/jrand48_r.c index 1a89790525..648604d4f5 100644 --- a/stdlib/jrand48_r.c +++ b/stdlib/jrand48_r.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/stdlib/labs.c b/stdlib/labs.c index 3fcef26df9..8c490c0312 100644 --- a/stdlib/labs.c +++ b/stdlib/labs.c @@ -1,22 +1,21 @@ -/* Copyright (C) 1991 Free Software Foundation, Inc. -This file is part of the GNU C Library. +/* Copyright (C) 1991, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ -#include #include #undef labs @@ -24,7 +23,7 @@ Cambridge, MA 02139, USA. */ /* Return the absolute value of I. */ long int -DEFUN(labs, (i), long int i) +labs (long int i) { - return(i < 0 ? -i : i); + return i < 0 ? -i : i; } diff --git a/stdlib/lcong48.c b/stdlib/lcong48.c index 779dcc7c40..a9ef571867 100644 --- a/stdlib/lcong48.c +++ b/stdlib/lcong48.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include diff --git a/stdlib/lcong48_r.c b/stdlib/lcong48_r.c index 8584eddf0b..037fd4931e 100644 --- a/stdlib/lcong48_r.c +++ b/stdlib/lcong48_r.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper , August 1995. +/* Copyright (C) 1995, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , August 1995. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library