From d41c6f6161ef2b500b68d7599fcbc6a4c4ca2285 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 13 Oct 1996 21:35:39 +0000 Subject: [PATCH] update from main archvie 961013 Sun Oct 13 22:52:56 1996 Ulrich Drepper * shlib-versions: Add version number/name for ld.so. * Makeconfig: Move definition of rtld-installed-name after inclusion of soversions.mk. Don't add . before version number from shlib-versions file when when name does not start with digit. This is needed for ld.so. Sat Oct 12 20:31:58 1996 Richard Henderson * libio/iogets.c: Warn when gets used. * stdio/gets.c: Strengthen the warning. Sat Oct 12 23:10:43 1996 Ulrich Drepper * libio/Makefile [_LIBC_REENTRANT] (routines): Add peekc. * libio/libio.h: Add prototypes for _IO_getc, _IO_putc, _IO_feof, _IO_ferror, _IO_peekc_locked, and _IO_ftrylockfile. Remove prototypes for _IO_getc_locked and _IO_putc_locked. [_IO_MTSAFE_IO]: Add weak aliases for _IO_flockfile and _IO_funlockfile. [! _IO_MTSAFE_IO]: Define _IO_ftrylockfile as empty. Define _IO_getc, _IO_peekc, _IO_putc, _IO_feof, _IO_ferror to appropriate values according to __USE_REENTRANT. * libio/stdio.h: Add prototype for ftrylockfile. [!_LIBC]: Define getc_locked, getchar_locked, putchar_locked, getc, getchar, putc, and putchar using _IO_* names. * libio/feof.c: Rename to _IO_feof and make feof weak alias. * libio/ferror.c: Rename to _IO_ferror and make ferror weak alias. * libio/getc.c: Rename to _IO_getc and make getc weak alias. * libio/putc.c: Rename to _IO_putc and make putc weak alias. * libio/putc_u.c: Don't define alias _IO_putc_unlocked. * libio/peekc.c: New file. * stdio-common/vfprintf.c (vfprintf): Unconditionally call __flockfile. * sysdeps/stub/locfile.c [USE_IN_LIBIO]: Also define _IO_* names. * crypt/Makefile (tests): Add md5test and md5c-test. * crypt/md5-crypt.c: Correct various error. Now md5_process_bytes is called, the buffer limit is honoured and a loop in a inner loop is corrected. * crypt/md5.h (struct md5_ctx): Add new fields. Add prototypes for new functions. * crypt/md5.c (md5_init_ctx): Initialize new fields. (md5_finish_ctx): New function. Like md5_read_ctx but before perform correct finalization. (md5_process_bytes): New function. Similar to md5_proces_block, but does not require input size to be multiple of 64. (md5_stream): Rewrite using md5_process_bytes and md5_finish_ctx. (md5_buffer): Likewise. (md5_process_block): Count number of bytes. * crypt/md5test.c: New file. Test program for MD5 functions. * crypt/md5c-test.c: New file: Test program for MD5 crypt function. * po/fr.po: Update. * time/strptime.c: Recognize %s, %u, %g, and %G format. * posix/getopt.c: Add some more casts and initializations to prevent warnings. Sat Oct 12 16:15:29 1996 Ulrich Drepper * sysdeps/unix/sysv/linux/speed.c (speeds): Removed. We provide an extra function to provide this functionality. (cfgetospeed): Simply return masked value. (cfsetospeed): Don't use speeds array and so we can simply test the value of SPEED for illegal values. * termios/cfsetspeed.c: Rewrite. We convert here between the real values and the B* constants. Changes suggested by Uwe Ohse . Fri Oct 11 21:45:34 1996 Andreas Jaeger * locale/programs/xstrdup.c: Define prototypes. * locale/programs/xmalloc.c: Likewise. * stdio-common/xbug.c (main): Change definition to avoid warning. Fri Oct 11 23:36:31 1996 Miles Bader * db/hash/hash.c (__hash_open): Correctly test for a read-write db. --- ChangeLog | 86 ++++++++++++++++++++++++++++++++++ Makeconfig | 27 +++++++---- PROJECTS | 24 +++++++--- libio/Makefile | 2 +- libio/feof.c | 5 +- libio/ferror.c | 3 +- libio/getc.c | 6 ++- libio/iogets.c | 2 + libio/libio.h | 35 +++++++++++--- libio/{getc.c => peekc.c} | 12 ++--- libio/putc.c | 6 ++- libio/putc_u.c | 4 -- libio/stdio.h | 13 ++++-- locale/programs/xmalloc.c | 3 ++ locale/programs/xstrdup.c | 5 +- po/fr.po | 4 +- posix/getopt.c | 4 +- shlib-versions | 7 ++- stdio-common/vfprintf.c | 4 +- stdio-common/xbug.c | 2 +- stdio/gets.c | 3 +- sysdeps/stub/e_fmodl.c | 11 +++++ sysdeps/stub/lockfile.c | 11 ++++- sysdeps/unix/sysv/linux/speed.c | 60 +++--------------------- termios/cfsetspeed.c | 100 +++++++++++++++++++++++++++++++++++++--- time/strptime.c | 44 +++++++++++++++++- 26 files changed, 359 insertions(+), 124 deletions(-) copy libio/{getc.c => peekc.c} (90%) create mode 100644 sysdeps/stub/e_fmodl.c diff --git a/ChangeLog b/ChangeLog index eed04ff607..5e5ec98cc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,89 @@ +Sun Oct 13 22:52:56 1996 Ulrich Drepper + + * shlib-versions: Add version number/name for ld.so. + * Makeconfig: Move definition of rtld-installed-name after + inclusion of soversions.mk. + Don't add . before version number from shlib-versions file when + when name does not start with digit. This is needed for ld.so. + +Sat Oct 12 20:31:58 1996 Richard Henderson + + * libio/iogets.c: Warn when gets used. + * stdio/gets.c: Strengthen the warning. + +Sat Oct 12 23:10:43 1996 Ulrich Drepper + + * libio/Makefile [_LIBC_REENTRANT] (routines): Add peekc. + * libio/libio.h: Add prototypes for _IO_getc, _IO_putc, _IO_feof, + _IO_ferror, _IO_peekc_locked, and _IO_ftrylockfile. + Remove prototypes for _IO_getc_locked and _IO_putc_locked. + [_IO_MTSAFE_IO]: Add weak aliases for _IO_flockfile and + _IO_funlockfile. + [! _IO_MTSAFE_IO]: Define _IO_ftrylockfile as empty. + Define _IO_getc, _IO_peekc, _IO_putc, _IO_feof, _IO_ferror to + appropriate values according to __USE_REENTRANT. + * libio/stdio.h: Add prototype for ftrylockfile. + [!_LIBC]: Define getc_locked, getchar_locked, putchar_locked, + getc, getchar, putc, and putchar using _IO_* names. + * libio/feof.c: Rename to _IO_feof and make feof weak alias. + * libio/ferror.c: Rename to _IO_ferror and make ferror weak alias. + * libio/getc.c: Rename to _IO_getc and make getc weak alias. + * libio/putc.c: Rename to _IO_putc and make putc weak alias. + * libio/putc_u.c: Don't define alias _IO_putc_unlocked. + * libio/peekc.c: New file. + + * stdio-common/vfprintf.c (vfprintf): Unconditionally call + __flockfile. + + * sysdeps/stub/locfile.c [USE_IN_LIBIO]: Also define _IO_* names. + + * crypt/Makefile (tests): Add md5test and md5c-test. + * crypt/md5-crypt.c: Correct various error. Now md5_process_bytes + is called, the buffer limit is honoured and a loop in a inner + loop is corrected. + * crypt/md5.h (struct md5_ctx): Add new fields. + Add prototypes for new functions. + * crypt/md5.c (md5_init_ctx): Initialize new fields. + (md5_finish_ctx): New function. Like md5_read_ctx but before + perform correct finalization. + (md5_process_bytes): New function. Similar to md5_proces_block, + but does not require input size to be multiple of 64. + (md5_stream): Rewrite using md5_process_bytes and md5_finish_ctx. + (md5_buffer): Likewise. + (md5_process_block): Count number of bytes. + * crypt/md5test.c: New file. Test program for MD5 functions. + * crypt/md5c-test.c: New file: Test program for MD5 crypt + function. + + * po/fr.po: Update. + + * time/strptime.c: Recognize %s, %u, %g, and %G format. + + * posix/getopt.c: Add some more casts and initializations to + prevent warnings. + +Sat Oct 12 16:15:29 1996 Ulrich Drepper + + * sysdeps/unix/sysv/linux/speed.c (speeds): Removed. We provide + an extra function to provide this functionality. + (cfgetospeed): Simply return masked value. + (cfsetospeed): Don't use speeds array and so we can simply test + the value of SPEED for illegal values. + * termios/cfsetspeed.c: Rewrite. We convert here between the + real values and the B* constants. + Changes suggested by Uwe Ohse . + +Fri Oct 11 21:45:34 1996 Andreas Jaeger + + * locale/programs/xstrdup.c: Define prototypes. + * locale/programs/xmalloc.c: Likewise. + + * stdio-common/xbug.c (main): Change definition to avoid warning. + +Fri Oct 11 23:36:31 1996 Miles Bader + + * db/hash/hash.c (__hash_open): Correctly test for a read-write db. + Fri Oct 11 19:13:34 1996 Ulrich Drepper * locale/Makefile (CPPFLAGS): Set CHARMAP_PATH to diff --git a/Makeconfig b/Makeconfig index 2a76ca34d8..39d4fbd8ef 100644 --- a/Makeconfig +++ b/Makeconfig @@ -353,15 +353,6 @@ csu-objpfx = $(common-objpfx)csu/ elf-objpfx = $(common-objpfx)elf/ db-objpfx = $(common-objpfx)db/ -ifeq (yes,$(build-shared)) -# The name under which the run-time dynamic linker is installed. -# We are currently going for the convention that `/lib/ld.so.1' -# names the SVR4/ELF ABI-compliant dynamic linker. -ifndef rtld-installed-name -rtld-installed-name = ld.so.1 -endif -endif - # How to run a program we just linked with our library. # The program binary is assumed to be $(word 2,$^). built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^)) @@ -539,7 +530,11 @@ $(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \ lib=`echo $$v | sed 's/=.*$$//'`; \ if eval "test -z \"\$$vers_lib$$lib\""; then \ eval vers_lib$${lib}=yes; \ - echo $$v | sed "s/^.*=/$$lib.so-version=./"; \ + number=`echo $$v | sed "s/^.*=//"`; \ + case $$number in \ + [0-9]*) echo "$$lib.so-version=.$$number";; \ + *) echo "$$lib.so-version=$$number";; \ + esac; \ fi; \ done ;; esac; done; \ done;) > $@T; exit 0 @@ -548,6 +543,18 @@ $(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \ # Get $(version) defined with the release version number. -include $(common-objpfx)version.mk + +# The name under which the run-time dynamic linker is installed. +# We are currently going for the convention that `/lib/ld.so.1' +# names the SVR4/ELF ABI-compliant dynamic linker. +ifndef rtld-installed-name +ifdef ld.so-version +rtld-installed-name = $(ld.so-version) +else +rtld-installed-name = ld.so.1 +endif +endif + endif # build-shared endif # Makeconfig not yet included diff --git a/PROJECTS b/PROJECTS index 60ab664307..9f9d3bed33 100644 --- a/PROJECTS +++ b/PROJECTS @@ -1,6 +1,6 @@ Open jobs for finishing GNU libc: --------------------------------- -Status: August 1996 +Status: October 1996 If you have time and talent to take over any of the jobs below please contact @@ -26,7 +26,7 @@ contact for the current status (of course better use a mirror of prep). -[ 4] Write wordexp() function; this is described in POSIX.2, The +[ 4] Write wordexp() function; this is described in POSIX.2, the header already exists. Implementation idea: use some functions from bash. @@ -51,9 +51,9 @@ contact Henry Spencer, University of Toronto Usenix Winter '92, pp. 419--428 - or just ask. Currently mostly i?86 optimized versions exist. - Alpha versions are on their way, so please ask before working - on this. + or just ask. Currently mostly i?86 and Alpha optimized versions + exist. Please ask before working on this to avoid duplicate + work. [ 7] Write nftw() function. Perhaps it might be good to reimplement the @@ -67,7 +67,11 @@ contact There is a public domain version but using this would cause problems with the assignment. -[ 9] Extend regex and/or rx to work with wide characters. + +[ 9] Extend regex and/or rx to work with wide characters and complete + implementation of character class and collation class handling. + + It is planed to do a complete rewrite. [10] Add mmap() support to malloc(). @@ -82,7 +86,15 @@ contact Please contact bug-glibc@prep.ai.mit.edu before starting to avoid duplicated work. + [11] Write access function for netmasks, bootparams, publickey, automount, and aliases databases for nss_files and nss_db module. The functions should be embedded in the nss scheme. This is not hard and not all services must be supported at once. + + +[12] Rewrite utmp/wtmp functions to use database functions. This is much + better than the normal flat file format. + + Please contact bug-glibc@prep.ai.mit.edu before starting to avoid + duplicated work. diff --git a/libio/Makefile b/libio/Makefile index ba64fc7752..0c34125ac6 100644 --- a/libio/Makefile +++ b/libio/Makefile @@ -42,7 +42,7 @@ include ../Makeconfig ifneq (,$(filter %REENTRANT, $(defines))) routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u \ - iofflush_u putc_u putchar_u + iofflush_u putc_u putchar_u peekc CPPFLAGS += -D_IO_MTSAFE_IO endif diff --git a/libio/feof.c b/libio/feof.c index 9fb0008afb..34ca1da161 100644 --- a/libio/feof.c +++ b/libio/feof.c @@ -25,7 +25,7 @@ the executable file might be covered by the GNU General Public License. */ #include "stdio.h" int -feof (fp) +_IO_feof (fp) _IO_FILE* fp; { int result; @@ -35,11 +35,12 @@ feof (fp) _IO_funlockfile (fp); return result; } +weak_alias (_IO_feof, feof) #ifdef _IO_MTSAFE_IO /* The feof implementation for libio does not require locking because it only accesses once a single variable and this is already atomic (at least at thread level). */ -weak_alias (feof, feof_locked) +weak_alias (_IO_feof, feof_locked) #endif diff --git a/libio/ferror.c b/libio/ferror.c index 32fd6d0dd9..4f75092149 100644 --- a/libio/ferror.c +++ b/libio/ferror.c @@ -25,7 +25,7 @@ the executable file might be covered by the GNU General Public License. */ #include "stdio.h" int -ferror (fp) +_IO_ferror (fp) _IO_FILE* fp; { int result; @@ -35,6 +35,7 @@ ferror (fp) _IO_funlockfile (fp); return result; } +weak_alias (_IO_ferror, ferror) #ifdef _IO_MTSAFE_IO diff --git a/libio/getc.c b/libio/getc.c index c345e44ca6..0c0b6b84d3 100644 --- a/libio/getc.c +++ b/libio/getc.c @@ -25,10 +25,10 @@ the executable file might be covered by the GNU General Public License. */ #include "libioP.h" #include "stdio.h" -#undef getc +#undef _IO_getc int -getc (fp) +_IO_getc (fp) FILE *fp; { int result; @@ -39,6 +39,8 @@ getc (fp) __libc_cleanup_region_end (1); return result; } +#undef getc +weak_alias (_IO_getc, getc) #ifdef _IO_MTSAFE_IO # undef getc_locked diff --git a/libio/iogets.c b/libio/iogets.c index e132093e48..716ecd1b18 100644 --- a/libio/iogets.c +++ b/libio/iogets.c @@ -53,3 +53,5 @@ _IO_gets (buf) } weak_alias (_IO_gets, gets) + +link_warning (gets, "the `gets' function is dangerous and should not be used.") diff --git a/libio/libio.h b/libio/libio.h index e174ee183d..5118b1e980 100644 --- a/libio/libio.h +++ b/libio/libio.h @@ -26,6 +26,7 @@ the executable file might be covered by the GNU General Public License. */ #ifndef _IO_STDIO_H #define _IO_STDIO_H +#include #include <_G_config.h> #define _IO_pos_t _G_fpos_t /* obsolete */ @@ -262,21 +263,43 @@ extern int __overflow __P((_IO_FILE*, int)); #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0) #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0) +extern int _IO_getc __P ((_IO_FILE *__fp)); +extern int _IO_putc __P ((int __c, _IO_FILE *__fp)); +extern int _IO_feof __P ((_IO_FILE *__fp)); +extern int _IO_ferror __P ((_IO_FILE *__fp)); + +extern int _IO_peekc_locked __P ((_IO_FILE *__fp)); + /* This one is for Emacs. */ #define _IO_PENDING_OUTPUT_COUNT(_fp) \ ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base) -extern int _IO_getc_locked __P ((_IO_FILE *)); -extern int _IO_putc_locked __P ((int, _IO_FILE *)); - extern void _IO_flockfile __P ((_IO_FILE *)); extern void _IO_funlockfile __P ((_IO_FILE *)); +extern int _IO_ftrylockfile __P ((_IO_FILE *)); -#ifndef _IO_MTSAFE_IO -# define _IO_flockfile(FILE) /**/ -# define _IO_funlockfile(FILE) /**/ +#ifdef _IO_MTSAFE_IO +weak_extern (_IO_flockfile) +weak_extern (_IO_funlockfile) +#else +# define _IO_flockfile(_fp) /**/ +# define _IO_funlockfile(_fp) /**/ +# define _IO_ftrylockfile(_fp) /**/ #endif /* !_IO_MTSAFE_IO */ +#ifdef __USE_REENTRANT +# define _IO_getc(_fp) _IO_getc (_fp) +# define _IO_peekc(_fp) _IO_peekc_locked (_fp) +# define _IO_putc(_ch, _fp) _IO_putc (_ch, _fp) +# define _IO_feof(_fp) _IO_feof (_fp) +# define _IO_ferror(_fp) _IO_ferror (_fp) +#else +# define _IO_getc(_fp) _IO_getc_unlocked (_fp) +# define _IO_peekc(_fp) _IO_peekc_unlocked (_fp) +# define _IO_putc(_ch, _fp) _IO_putc_unlocked (_ch, _fp) +# define _IO_feof(_fp) _IO_feof_unlocked (_fp) +# define _IO_ferror(_fp) _IO_ferror_unlocked (_fp) +#endif extern int _IO_vfscanf __P((_IO_FILE*, const char*, _IO_va_list, int*)); extern int _IO_vfprintf __P((_IO_FILE*, const char*, _IO_va_list)); diff --git a/libio/getc.c b/libio/peekc.c similarity index 90% copy from libio/getc.c copy to libio/peekc.c index c345e44ca6..2b0a812868 100644 --- a/libio/getc.c +++ b/libio/peekc.c @@ -25,23 +25,17 @@ the executable file might be covered by the GNU General Public License. */ #include "libioP.h" #include "stdio.h" -#undef getc +#undef _IO_peekc int -getc (fp) +_IO_peekc_locked (fp) FILE *fp; { int result; CHECK_FILE (fp, EOF); __libc_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp); _IO_flockfile (fp); - result = _IO_getc_unlocked (fp); + result = _IO_peekc_unlocked (fp); __libc_cleanup_region_end (1); return result; } - -#ifdef _IO_MTSAFE_IO -# undef getc_locked - -weak_alias (getc, getc_locked) -#endif diff --git a/libio/putc.c b/libio/putc.c index bc69e2efb7..5aa3b68137 100644 --- a/libio/putc.c +++ b/libio/putc.c @@ -19,10 +19,10 @@ Cambridge, MA 02139, USA. */ #include "libioP.h" #include "stdio.h" -#undef putc +#undef _IO_putc int -putc (c, fp) +_IO_putc (c, fp) int c; _IO_FILE *fp; { @@ -34,6 +34,8 @@ putc (c, fp) __libc_cleanup_region_end (1); return result; } +#undef putc +weak_alias (_IO_putc, putc) #ifdef _IO_MTSAFE_IO # undef putc_locked diff --git a/libio/putc_u.c b/libio/putc_u.c index 85912e583f..18bbd491d8 100644 --- a/libio/putc_u.c +++ b/libio/putc_u.c @@ -29,7 +29,3 @@ putc_unlocked (c, fp) CHECK_FILE (fp, EOF); return _IO_putc_unlocked (c, fp); } - -#ifdef _LIBC_REENTRANT -weak_alias (putc_unlocked, _IO_putc_unlocked) -#endif diff --git a/libio/stdio.h b/libio/stdio.h index c71cf4d1d2..a47b663cae 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -221,6 +221,7 @@ extern int fileno_locked __P ((FILE *)); extern int fileno_unlocked __P ((FILE *)); extern void flockfile __P ((FILE *)); extern void funlockfile __P ((FILE *)); +extern int ftrylockfile __P ((FILE *)); extern int fclose_unlocked __P ((FILE *)); extern int fflush_locked __P ((FILE *)); extern int fflush_unlocked __P ((FILE *)); @@ -240,17 +241,19 @@ extern int putchar_unlocked __P ((int)); # ifndef _LIBC # define getc_unlocked(fp) _IO_getc_unlocked (fp) -# define getc_locked(fp) fgetc (fp) +# define getc_locked(fp) _IO_getc (fp) # define getchar_unlocked() _IO_getc_unlocked (stdin) -# define getchar_locked() getc (stdin) +# define getchar_locked() _IO_getc (stdin) # define putchar_unlocked(c) _IO_putc_unlocked (c, stdout) -# define putchar_locked(c) putc (c, stdout) +# define putchar_locked(c) _IO_putc (c, stdout) # endif #endif /* __USE_REENTRANT */ -#define putchar(c) putc (c, stdout) -#define getchar() getc (stdin) +#define getc(_fp) _IO_getc (_fp) +#define putc(_ch, _fp) _IO_putc (_ch, _fp) +#define putchar(_ch) _IO_putc (_ch, stdout) +#define getchar() _IO_getc (stdin) #ifdef __cplusplus diff --git a/locale/programs/xmalloc.c b/locale/programs/xmalloc.c index 0a10fbccf2..cbef26f7e5 100644 --- a/locale/programs/xmalloc.c +++ b/locale/programs/xmalloc.c @@ -30,6 +30,9 @@ #if STDC_HEADERS || _LIBC #include static VOID *fixup_null_alloc __P ((size_t n)); +VOID *xmalloc __P ((size_t n)); +VOID *xcalloc __P ((size_t n, size_t s)); +VOID *xrealloc __P ((VOID *p, size_t n)); #else VOID *calloc (); VOID *malloc (); diff --git a/locale/programs/xstrdup.c b/locale/programs/xstrdup.c index 1b5b415b2b..69ad9950ad 100644 --- a/locale/programs/xstrdup.c +++ b/locale/programs/xstrdup.c @@ -1,5 +1,5 @@ /* xstrdup.c -- copy a string with out of memory checking - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1996 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,8 @@ #else #include #endif -char *xmalloc (); +void *xmalloc __P ((size_t n)); +char *xstrdup __P ((char *string)); /* Return a newly allocated copy of STRING. */ diff --git a/po/fr.po b/po/fr.po index 94c54e838c..62fdd23690 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,4 +1,4 @@ -# Messages frangais pour GNU concernant gcal. +# Messages français pour GNU concernant libc. # Copyright (C) 1996 Free Software Foundation, Inc. # Michel Robitaille , 1996. # @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: GNU libc 1.94\n" "POT-Creation-Date: 1996-09-08 03:45 -0400\n" -"PO-Revision-Date: 1996-09-29 14:50 -0400\n" +"PO-Revision-Date: 1996-10-10 19:03 -0400\n" "Last-Translator: Michel Robitaille \n" "Language-Team: French \n" "MIME-Version: 1.0\n" diff --git a/posix/getopt.c b/posix/getopt.c index 76346c2ac3..f4507d42d6 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -701,7 +701,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) const struct option *pfound = NULL; int exact = 0; int ambig = 0; - int indfound; + int indfound = 0; int option_index; /* This is an option that requires an argument. */ @@ -743,7 +743,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { - if (nameend - nextchar == strlen (p->name)) + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; diff --git a/shlib-versions b/shlib-versions index b6d8201628..0c94f3ba2f 100644 --- a/shlib-versions +++ b/shlib-versions @@ -27,6 +27,11 @@ alpha-*-linux* libc=6 # libc.so.0.2 is for the Hurd alpha release 0.2. *-*-gnu* libc=0.2 +# The dynamic loader also requires different names. +i?86-*-linux* ld=ld-linux.so.2 +# We use the ELF ABI standard name for the default. +*-*-* ld=ld.so.1 + # The -ldl interface (see ) is the same on all platforms. *-*-* libdl=2 @@ -34,7 +39,7 @@ alpha-*-linux* libc=6 # `struct utmp' format, which depends on libc. *-*-* libutil=1 -# Version number 2 is used on other systems for the BIND 4.9.4 resolver +# Version number 2 is used on other systems for the BIND 4.9.5 resolver # interface. *-*-* libresolv=2 diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index 7714c0e67f..7c2b50c2e5 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -850,9 +850,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap) /* Lock stream. */ __libc_cleanup_region_start ((void (*) (void *)) &__funlockfile, s); - - if (__flockfile != NULL) - __flockfile (s); + __flockfile (s); /* Write the literal text before the first format. */ outstring ((const UCHAR_T *) format, diff --git a/stdio-common/xbug.c b/stdio-common/xbug.c index fc60c66be9..7ab76f051a 100644 --- a/stdio-common/xbug.c +++ b/stdio-common/xbug.c @@ -54,7 +54,7 @@ void ReadFile(buffer, input) int main(int argc, char *argv[]) { - char * filename = "xbug.c"; + char filename[] = "xbug.c"; FILE *input; Buffer buffer; diff --git a/stdio/gets.c b/stdio/gets.c index 7f84c92df3..0a01126b91 100644 --- a/stdio/gets.c +++ b/stdio/gets.c @@ -20,8 +20,7 @@ Cambridge, MA 02139, USA. */ #include #include -link_warning (gets, - "the `gets' function is unreliable and should not be used.") +link_warning (gets, "the `gets' function is dangerous and should not be used.") /* Read a newline-terminated string from stdin into S, removing the trailing newline. Return S or NULL. */ diff --git a/sysdeps/stub/e_fmodl.c b/sysdeps/stub/e_fmodl.c new file mode 100644 index 0000000000..b47912581b --- /dev/null +++ b/sysdeps/stub/e_fmodl.c @@ -0,0 +1,11 @@ +#include +#include + +long double +__ieee754_fmodl (long double x, long double y) +{ + fputs ("__ieee754_fmodl not implemented\n", stderr); + return 0.0; +} + +stub_warning (__ieee754_fmodl) diff --git a/sysdeps/stub/lockfile.c b/sysdeps/stub/lockfile.c index 0942e04de0..61d03a7c72 100644 --- a/sysdeps/stub/lockfile.c +++ b/sysdeps/stub/lockfile.c @@ -17,7 +17,7 @@ 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 +typedef FILE; void @@ -25,6 +25,9 @@ __flockfile (FILE *stream) { /* Do nothing. Using this version does not do any locking. */ } +#ifdef USE_IN_LIBIO +strong_alias (__flockfile, _IO_flockfile) +#endif weak_alias (__flockfile, flockfile); @@ -33,6 +36,9 @@ __funlockfile (FILE *stream) { /* Do nothing. Using this version does not do any locking. */ } +#ifdef USE_IN_LIBIO +strong_alias (__funlockfile, _IO_funlockfile) +#endif weak_alias (__funlockfile, funlockfile); @@ -42,4 +48,7 @@ __ftrylockfile (FILE *stream) /* Do nothing. Using this version does not do any locking. */ return 1; } +#ifdef USE_IN_LIBIO +strong_alias (__ftrylockfile, _IO_ftrylockfile) +#endif weak_alias (__ftrylockfile, ftrylockfile); diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c index 9dd5e2f269..ba8b122f6c 100644 --- a/sysdeps/unix/sysv/linux/speed.c +++ b/sysdeps/unix/sysv/linux/speed.c @@ -21,48 +21,13 @@ Cambridge, MA 02139, USA. */ #include #include -static const speed_t speeds[] = - { - 0, - 50, - 75, - 110, - 134, - 150, - 200, - 300, - 600, - 1200, - 1800, - 2400, - 4800, - 9600, - 19200, - 38400, -#ifndef __alpha__ - 38400, /* Mention this twice here is a trick. */ -#endif - 57600, - 115200, - 230400, - 460800, - }; - /* Return the output baud rate stored in *TERMIOS_P. */ speed_t cfgetospeed (termios_p) const struct termios *termios_p; { - speed_t retval = termios_p->c_cflag & (CBAUD | CBAUDEX); - - if (retval & CBAUDEX) - { - retval &= ~CBAUDEX; - retval |= CBAUD + 1; - } - - return retval; + return termios_p->c_cflag & (CBAUD | CBAUDEX); } /* Return the input baud rate stored in *TERMIOS_P. @@ -75,30 +40,17 @@ cfsetospeed (termios_p, speed) struct termios *termios_p; speed_t speed; { - register unsigned int i; - - if (termios_p == NULL) + if ((speed & ~CBAUD) != 0 + && (speed < B57600 || speed > B460800)) { __set_errno (EINVAL); return -1; } - /* This allows either B1200 or 1200 to work. XXX - Do we really want to try to support this, given that - fetching the speed must return one or the other? */ - - for (i = 0; i < sizeof (speeds) / sizeof (speeds[0]); ++i) - if (i == speed || speeds[i] == speed) - { - termios_p->c_cflag &= ~(CBAUD | CBAUDEX); - termios_p->c_cflag |= (i & CBAUD); - if (i & ~CBAUD) - termios_p->c_cflag |= CBAUDEX; - return 0; - } + termios_p->c_cflag &= ~(CBAUD | CBAUDEX); + termios_p->c_cflag |= speed; - __set_errno (EINVAL); - return -1; + return 0; } /* Set the input baud rate stored in *TERMIOS_P to SPEED. diff --git a/termios/cfsetspeed.c b/termios/cfsetspeed.c index a4a205b52f..5f22eade4b 100644 --- a/termios/cfsetspeed.c +++ b/termios/cfsetspeed.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1993 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1993, 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 @@ -16,16 +16,104 @@ 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. */ -#include #include #include #include +static struct speed_struct +{ + speed_t value; + speed_t internal; +} speeds[] = + { +#ifdef B0 + { 0, B0 }, +#endif +#ifdef B50 + { 50, B50 }, +#endif +#ifdef B75 + { 75, B75 }, +#endif +#ifdef B110 + { 110, B110 }, +#endif +#ifdef B134 + { 134, B134 }, +#endif +#ifdef B150 + { 150, B150 }, +#endif +#ifdef B200 + { 200, B200 }, +#endif +#ifdef B300 + { 300, B300 }, +#endif +#ifdef B600 + { 600, B600 }, +#endif +#ifdef B1200 + { 1200, B1200 }, +#endif +#ifdef B1200 + { 1200, B1200 }, +#endif +#ifdef B1800 + { 1800, B1800 }, +#endif +#ifdef B2400 + { 2400, B2400 }, +#endif +#ifdef B4800 + { 4800, B4800 }, +#endif +#ifdef B9600 + { 9600, B9600 }, +#endif +#ifdef B19200 + { 19200, B19200 }, +#endif +#ifdef B38400 + { 38400, B38400 }, +#endif +#ifdef B57600 + { 57600, B57600 }, +#endif +#ifdef B76800 + { 76800, B76800 }, +#endif +#ifdef B115200 + { 115200, B115200 }, +#endif +#ifdef B153600 + { 153600, B153600 }, +#endif +#ifdef B230400 + { 230400, B230400 }, +#endif +#ifdef B307200 + { 307200, B307200 }, +#endif +#ifdef B460800 + { 460800, B460800 }, +#endif + }; + + /* Set both the input and output baud rates stored in *TERMIOS_P to SPEED. */ void -DEFUN(cfsetspeed, (termios_p, speed), - struct termios *termios_p AND speed_t speed) +cfsetspeed (struct termios *termios_p, speed_t speed) { - cfsetispeed (termios_p, speed); - cfsetospeed (termios_p, speed); + size_t cnt; + + for (cnt = 0; cnt < sizeof (speeds); ++cnt) + if (speed == speeds[cnt].value) + { + cfsetispeed (termios_p, speed); + cfsetospeed (termios_p, speed); + return; + } + + __set_errno (EINVAL); } diff --git a/time/strptime.c b/time/strptime.c index cb3d126b9c..e2427e650b 100644 --- a/time/strptime.c +++ b/time/strptime.c @@ -70,7 +70,7 @@ Boston, MA 02111-1307, USA. */ if (rp == NULL) \ return NULL; \ } while (0) - + char * strptime (const char *buf, const char *format, struct tm *tm) @@ -211,6 +211,29 @@ strptime (const char *buf, const char *format, struct tm *tm) case 'R': recursive ("%H:%M"); break; + case 's': + { + /* The number of seconds may be very high so we cannot use + the `get_number' macro. Instead read the number + character for character and construct the result while + doing this. */ + time_t secs; + if (*rp < '0' || *rp > '9') + /* We need at least one digit. */ + return NULL; + + do + { + secs *= 10; + secs += *rp++ - '0'; + } + while (*rp >= '0' && *rp <= '9'); + + if (__localtime_r (&secs, tm) == NULL) + /* Error in function. */ + return NULL; + } + break; case 'S': get_number (0, 61); tm->tm_sec = val; @@ -218,6 +241,23 @@ strptime (const char *buf, const char *format, struct tm *tm) case 'T': recursive ("%H:%M:%S"); break; + case 'u': + get_number (1, 7); + tm->tm_wday = val % 7; + break; + case 'g': + get_number (0, 99); + /* XXX This cannot determine any field in TM. */ + break; + case 'G': + if (*rp < '0' || *rp > '9') + return NULL; + /* XXX Ignore the number since we would need some more + information to compute a real date. */ + do + ++rp; + while (*rp >= '0' && *rp <= '9'); + break; case 'U': case 'V': case 'W': @@ -339,6 +379,6 @@ strptime (const char *buf, const char *format, struct tm *tm) if (have_I && is_pm) tm->tm_hour += 12; - + return (char *) rp; } -- 2.11.4.GIT