summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-22 18:49:27 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-22 18:49:27 +0000
commitf43ce637b5f35b350b4dff6810dd6a7421fbb952 (patch)
tree9059744db9ed114b2e140a094505bea14316c667
parent6973fc01278d6c8a5f309738d641a68228efe5ed (diff)
downloadglibc-f43ce637b5f35b350b4dff6810dd6a7421fbb952.tar.gz
1997-11-22 19:28 Ulrich Drepper <drepper@cygnus.com> * iconv/gconv_simple.c: Fix lots of bugs. * iconv/iconv_open.c: Normalize names before passing them to __gconv_open. * libio/iolibio.h: Add prototypes for _IO_{new,old}_fclose. * libio/iopopen.c: Check for correct mode argument and punt otherwise. * stdio-common/test-popen.c: Add test for above change. * math/libm-test.c: Print test results also using %a format, specified in PRINTF_XEXPR macro. * math/test-double.c: Define PRINTF_XEXPR. * math/test-float.c: Likewise. * math/test-ldouble.c: Likewise. * math/test-idouble.c: Likewise. * math/test-ifloat.c: Likewise. * math/test-ildoubl.c: Likewise. * stdio-common/vfscanf.c: Recognize a in format specifier only as modifier if used before s, S, or [. Otherwise it's the hexadecimal FP number format. * stdlib/strtod.c: Little code cleanup. * sysdeps/i386/Makefile: Define __LIBC_INTERNAL_MATH_INLINES for compiling in math subdir. * sysdeps/m68k/fpu/e_acos.c: Define __LIBC_INTERNAL_MATH_INLINES instead of __LIBC_M81_MATH_INLINES. * sysdeps/m68k/fpu/e_atan2.c: Likewise. * sysdeps/m68k/fpu/e_fmod.c: Likewise. * sysdeps/m68k/fpu/e_pow.c: Likewise. * sysdeps/m68k/fpu/e_scalb.c: Likewise. * sysdeps/m68k/fpu/k_cos.c: Likewise. * sysdeps/m68k/fpu/k_sin.c: Likewise. * sysdeps/m68k/fpu/k_tan.c: Likewise. * sysdeps/m68k/fpu/s_atan.c: Likewise. * sysdeps/m68k/fpu/s_ccos.c: Likewise. * sysdeps/m68k/fpu/s_ccosh.c: Likewise. * sysdeps/m68k/fpu/s_cexp.c: Likewise. * sysdeps/m68k/fpu/s_csin.c: Likewise. * sysdeps/m68k/fpu/s_csinh.c: Likewise. * sysdeps/m68k/fpu/s_frexp.c: Likewise. * sysdeps/m68k/fpu/s_ilogb.c: Likewise. * sysdeps/m68k/fpu/s_isinf.c: Likewise. * sysdeps/m68k/fpu/s_llrint.c: Likewise. * sysdeps/m68k/fpu/s_llrintf.c: Likewise. * sysdeps/m68k/fpu/s_llrintl.c: Likewise. * sysdeps/m68k/fpu/s_lrint.c: Likewise. * sysdeps/m68k/fpu/s_modf.c: Likewise. * sysdeps/m68k/fpu/s_remquo.c: Likewise. * sysdeps/m68k/fpu/s_scalbn.c: Likewise. * sysdeps/m68k/fpu/s_sincos.c: Likewise. * sysdeps/m68k/fpu/bits/mathinline.h: Define optimizations if __LIBC_INTERNAL_MATH_INLINES is defined. * sysdeps/i386/fpu/bits/mathinline.h: Define special i686 versions of compare macros from ISO C 9X. Optimize generic versions a bit. Define __signbit inline functions and __ieee754_sqrt which can be used if the ompiler is fixed. * sysdeps/posix/sysv_signal.c: Define sysv_signal as weak alias. 1997-11-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules ($(common-objpfx)stub-$(subdir)): Look for sysdeps/generic in the whole dep file, not only in the first line. 1997-11-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/ieee754/bits/nan.h (__nan) [!__GNUC__]: Fix type. 1997-11-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * manual/arith.texi (Imaginary Unit): Move @end deftypevr to right place. 1997-11-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * elf/dl-error.c (_dl_signal_error): Only print colon if OBJNAME is non-empty. 1997-11-20 16:51 Ulrich Drepper <drepper@cygnus.com> * malloc/malloc.c (malloc_update_mallinfo): Initialize struct for return value. 1997-11-19 21:36 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/getcwd.c: Free allocated buffer if readlink succeeds but the return value is too long. * stdio-common/printf_fphex.c: Determine sign of number correctly. 1997-11-19 02:45 Ulrich Drepper <drepper@cygnus.com> * libc.map: Export __divl, __reml, __divq, __remq, __divqu and __remqu for Alpha. 1997-11-18 23:08 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/sys/ucontext.h: Stub context file. * libio/iofprintf.c: Removed. We use the stdio-common version. * manual/Makefile (distribute): Add stdio-fp.c. * sysdeps/powerpc/Dist: Add ppc-mcount.S. * db2/Makefile (distribute): Add include/os_func.h, README and mutex/tsl_parisc.s. * hesiod/Makefile (distribute): Add README.hesiod. 1997-11-18 22:14 Ulrich Drepper <drepper@cygnus.com> * iconv/gconv.c: Correctly call transformation function. * manual/maint.texi: Document need of binutils 2.8.1.0.17. 1997-11-13 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/libm-ieee754/s_remquo.c (__remquo): Fix function (gave wrong results for e.g. remquo (3,2, &x)). * sysdeps/libm-ieee754/s_remquof.c (__remquof): Likewise. * sysdeps/libm-ieee754/s_remquol.c (__remquol): Likewise. 1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * configure.in (ld --version-script): Test if the same symbol maybe defined in all versions (needed by recent changes to libc.map and supported with binutils 2.8.1.0.17) and issue warning if versioning is not supported/enabled. (bash test): Correct test case. * math/libm-test.c: Added counting/reporting of number of test cases. * elf/Makefile ($(objpfx)rtldtbl.h): gawk is not longer required, use awk instead. * sysdeps/unix/sysv/linux/net/if.h: Add __BEGIN_DECLS/__END_DECLS. 1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * elf/dl-load.c (_dl_init_paths): Correct __mempcpy logic. 1997-11-18 18:04 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/pty.c: Define REVOKE to use revoke function. Replace revoke call by use of REVOKE. * sysdeps/unix/sysv/linux/pty.c: New file. Define REVOKE as empty and #include generic version. Suggested by Zack Weinberg <zack@rabi.phys.columbia.edu>. 1997-11-18 16:02 Ulrich Drepper <drepper@cygnus.com> * libc.map: Add socket functions with __libc_* names. Reported by Andreas Jaeger. 1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * libc.map: Tidy up (remove duplicates, sort entries). 1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de> * iconv/gconv.h: Add __BEGIN_DECLS/__END_DECLS. 1997-11-18 06:45 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/pty.c: Make thread safe. Fix bug when calling again after successful call. Patch by Marc Lehmann <pcg@goof.com>. 1997-11-17 Paul Eggert <eggert@twinsun.com> * time/mktime.c, time/strftime.c (_REENTRANT): #define, as some hosts need this to declare localtime_r properly. 1997-11-18 06:08 Ulrich Drepper <drepper@cygnus.com> * libc.map: Add iconv_open, iconv, and iconv_close.
-rw-r--r--ChangeLog184
-rw-r--r--Makerules2
-rw-r--r--README2
-rwxr-xr-xconfig.sub2
-rwxr-xr-xconfigure71
-rw-r--r--configure.in15
-rw-r--r--db2/Makefile9
-rw-r--r--elf/Makefile4
-rw-r--r--elf/dl-error.c2
-rw-r--r--elf/dl-load.c5
-rw-r--r--hesiod/Makefile2
-rw-r--r--iconv/gconv.c4
-rw-r--r--iconv/gconv.h4
-rw-r--r--iconv/gconv_simple.c36
-rw-r--r--iconv/iconv_open.c46
-rw-r--r--libc.map29
-rw-r--r--libio/iofprintf.c51
-rw-r--r--libio/iolibio.h2
-rw-r--r--libio/iopopen.c9
-rw-r--r--malloc/malloc.c3
-rw-r--r--manual/Makefile3
-rw-r--r--manual/arith.texi2
-rw-r--r--manual/maint.texi15
-rw-r--r--math/libm-test.c72
-rw-r--r--math/test-double.c1
-rw-r--r--math/test-float.c1
-rw-r--r--math/test-idouble.c1
-rw-r--r--math/test-ifloat.c1
-rw-r--r--math/test-ildoubl.c1
-rw-r--r--math/test-ldouble.c1
-rw-r--r--stdio-common/printf_fphex.c4
-rw-r--r--stdio-common/test-popen.c15
-rw-r--r--stdio-common/vfscanf.c8
-rw-r--r--stdlib/strtod.c20
-rw-r--r--sysdeps/generic/pty.c10
-rw-r--r--sysdeps/generic/sys/ucontext.h24
-rw-r--r--sysdeps/i386/Makefile6
-rw-r--r--sysdeps/i386/fpu/bits/mathinline.h117
-rw-r--r--sysdeps/ieee754/bits/nan.h2
-rw-r--r--sysdeps/libm-ieee754/s_remquo.c5
-rw-r--r--sysdeps/libm-ieee754/s_remquof.c5
-rw-r--r--sysdeps/libm-ieee754/s_remquol.c5
-rw-r--r--sysdeps/m68k/fpu/bits/mathinline.h106
-rw-r--r--sysdeps/m68k/fpu/e_acos.c2
-rw-r--r--sysdeps/m68k/fpu/e_atan2.c2
-rw-r--r--sysdeps/m68k/fpu/e_fmod.c2
-rw-r--r--sysdeps/m68k/fpu/e_pow.c2
-rw-r--r--sysdeps/m68k/fpu/e_scalb.c2
-rw-r--r--sysdeps/m68k/fpu/k_cos.c2
-rw-r--r--sysdeps/m68k/fpu/k_sin.c2
-rw-r--r--sysdeps/m68k/fpu/k_tan.c2
-rw-r--r--sysdeps/m68k/fpu/s_atan.c2
-rw-r--r--sysdeps/m68k/fpu/s_ccos.c2
-rw-r--r--sysdeps/m68k/fpu/s_ccosh.c2
-rw-r--r--sysdeps/m68k/fpu/s_cexp.c2
-rw-r--r--sysdeps/m68k/fpu/s_csin.c2
-rw-r--r--sysdeps/m68k/fpu/s_csinh.c2
-rw-r--r--sysdeps/m68k/fpu/s_frexp.c2
-rw-r--r--sysdeps/m68k/fpu/s_ilogb.c2
-rw-r--r--sysdeps/m68k/fpu/s_isinf.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrint.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrintf.c2
-rw-r--r--sysdeps/m68k/fpu/s_llrintl.c2
-rw-r--r--sysdeps/m68k/fpu/s_lrint.c2
-rw-r--r--sysdeps/m68k/fpu/s_modf.c2
-rw-r--r--sysdeps/m68k/fpu/s_remquo.c2
-rw-r--r--sysdeps/m68k/fpu/s_scalbn.c2
-rw-r--r--sysdeps/m68k/fpu/s_sincos.c2
-rw-r--r--sysdeps/posix/sysv_signal.c2
-rw-r--r--sysdeps/powerpc/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c21
-rw-r--r--sysdeps/unix/sysv/linux/net/if.h3
-rw-r--r--sysdeps/unix/sysv/linux/pty.c3
-rw-r--r--time/mktime.c5
-rw-r--r--time/strftime.c5
75 files changed, 704 insertions, 293 deletions
diff --git a/ChangeLog b/ChangeLog
index f373576dc7..d18f75fa39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,187 @@
+1997-11-22 19:28 Ulrich Drepper <drepper@cygnus.com>
+
+ * iconv/gconv_simple.c: Fix lots of bugs.
+ * iconv/iconv_open.c: Normalize names before passing them to
+ __gconv_open.
+
+ * libio/iolibio.h: Add prototypes for _IO_{new,old}_fclose.
+
+ * libio/iopopen.c: Check for correct mode argument and punt otherwise.
+ * stdio-common/test-popen.c: Add test for above change.
+
+ * math/libm-test.c: Print test results also using %a format,
+ specified in PRINTF_XEXPR macro.
+ * math/test-double.c: Define PRINTF_XEXPR.
+ * math/test-float.c: Likewise.
+ * math/test-ldouble.c: Likewise.
+ * math/test-idouble.c: Likewise.
+ * math/test-ifloat.c: Likewise.
+ * math/test-ildoubl.c: Likewise.
+
+ * stdio-common/vfscanf.c: Recognize a in format specifier only as
+ modifier if used before s, S, or [. Otherwise it's the hexadecimal
+ FP number format.
+
+ * stdlib/strtod.c: Little code cleanup.
+
+ * sysdeps/i386/Makefile: Define __LIBC_INTERNAL_MATH_INLINES for
+ compiling in math subdir.
+
+ * sysdeps/m68k/fpu/e_acos.c: Define __LIBC_INTERNAL_MATH_INLINES
+ instead of __LIBC_M81_MATH_INLINES.
+ * sysdeps/m68k/fpu/e_atan2.c: Likewise.
+ * sysdeps/m68k/fpu/e_fmod.c: Likewise.
+ * sysdeps/m68k/fpu/e_pow.c: Likewise.
+ * sysdeps/m68k/fpu/e_scalb.c: Likewise.
+ * sysdeps/m68k/fpu/k_cos.c: Likewise.
+ * sysdeps/m68k/fpu/k_sin.c: Likewise.
+ * sysdeps/m68k/fpu/k_tan.c: Likewise.
+ * sysdeps/m68k/fpu/s_atan.c: Likewise.
+ * sysdeps/m68k/fpu/s_ccos.c: Likewise.
+ * sysdeps/m68k/fpu/s_ccosh.c: Likewise.
+ * sysdeps/m68k/fpu/s_cexp.c: Likewise.
+ * sysdeps/m68k/fpu/s_csin.c: Likewise.
+ * sysdeps/m68k/fpu/s_csinh.c: Likewise.
+ * sysdeps/m68k/fpu/s_frexp.c: Likewise.
+ * sysdeps/m68k/fpu/s_ilogb.c: Likewise.
+ * sysdeps/m68k/fpu/s_isinf.c: Likewise.
+ * sysdeps/m68k/fpu/s_llrint.c: Likewise.
+ * sysdeps/m68k/fpu/s_llrintf.c: Likewise.
+ * sysdeps/m68k/fpu/s_llrintl.c: Likewise.
+ * sysdeps/m68k/fpu/s_lrint.c: Likewise.
+ * sysdeps/m68k/fpu/s_modf.c: Likewise.
+ * sysdeps/m68k/fpu/s_remquo.c: Likewise.
+ * sysdeps/m68k/fpu/s_scalbn.c: Likewise.
+ * sysdeps/m68k/fpu/s_sincos.c: Likewise.
+ * sysdeps/m68k/fpu/bits/mathinline.h: Define optimizations if
+ __LIBC_INTERNAL_MATH_INLINES is defined.
+
+ * sysdeps/i386/fpu/bits/mathinline.h: Define special i686 versions
+ of compare macros from ISO C 9X. Optimize generic versions a bit.
+ Define __signbit inline functions and __ieee754_sqrt which can be
+ used if the ompiler is fixed.
+
+ * sysdeps/posix/sysv_signal.c: Define sysv_signal as weak alias.
+
+1997-11-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makerules ($(common-objpfx)stub-$(subdir)): Look for
+ sysdeps/generic in the whole dep file, not only in the first line.
+
+1997-11-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * sysdeps/ieee754/bits/nan.h (__nan) [!__GNUC__]: Fix type.
+
+1997-11-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * manual/arith.texi (Imaginary Unit): Move @end deftypevr to right
+ place.
+
+1997-11-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * elf/dl-error.c (_dl_signal_error): Only print colon if OBJNAME
+ is non-empty.
+
+1997-11-20 16:51 Ulrich Drepper <drepper@cygnus.com>
+
+ * malloc/malloc.c (malloc_update_mallinfo): Initialize struct for
+ return value.
+
+1997-11-19 21:36 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/unix/sysv/linux/getcwd.c: Free allocated buffer if
+ readlink succeeds but the return value is too long.
+
+ * stdio-common/printf_fphex.c: Determine sign of number correctly.
+
+1997-11-19 02:45 Ulrich Drepper <drepper@cygnus.com>
+
+ * libc.map: Export __divl, __reml, __divq, __remq, __divqu and
+ __remqu for Alpha.
+
+1997-11-18 23:08 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/sys/ucontext.h: Stub context file.
+
+ * libio/iofprintf.c: Removed. We use the stdio-common version.
+
+ * manual/Makefile (distribute): Add stdio-fp.c.
+
+ * sysdeps/powerpc/Dist: Add ppc-mcount.S.
+
+ * db2/Makefile (distribute): Add include/os_func.h, README and
+ mutex/tsl_parisc.s.
+
+ * hesiod/Makefile (distribute): Add README.hesiod.
+
+1997-11-18 22:14 Ulrich Drepper <drepper@cygnus.com>
+
+ * iconv/gconv.c: Correctly call transformation function.
+
+ * manual/maint.texi: Document need of binutils 2.8.1.0.17.
+
+1997-11-13 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * sysdeps/libm-ieee754/s_remquo.c (__remquo): Fix function (gave
+ wrong results for e.g. remquo (3,2, &x)).
+ * sysdeps/libm-ieee754/s_remquof.c (__remquof): Likewise.
+ * sysdeps/libm-ieee754/s_remquol.c (__remquol): Likewise.
+
+1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * configure.in (ld --version-script): Test if the same symbol
+ maybe defined in all versions (needed by recent changes to
+ libc.map and supported with binutils 2.8.1.0.17) and issue warning
+ if versioning is not supported/enabled.
+ (bash test): Correct test case.
+
+ * math/libm-test.c: Added counting/reporting of number of test cases.
+
+ * elf/Makefile ($(objpfx)rtldtbl.h): gawk is not longer required,
+ use awk instead.
+
+ * sysdeps/unix/sysv/linux/net/if.h: Add __BEGIN_DECLS/__END_DECLS.
+
+1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * elf/dl-load.c (_dl_init_paths): Correct __mempcpy logic.
+
+1997-11-18 18:04 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/pty.c: Define REVOKE to use revoke function.
+ Replace revoke call by use of REVOKE.
+ * sysdeps/unix/sysv/linux/pty.c: New file. Define REVOKE as
+ empty and #include generic version.
+ Suggested by Zack Weinberg <zack@rabi.phys.columbia.edu>.
+
+1997-11-18 16:02 Ulrich Drepper <drepper@cygnus.com>
+
+ * libc.map: Add socket functions with __libc_* names.
+ Reported by Andreas Jaeger.
+
+1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * libc.map: Tidy up (remove duplicates, sort entries).
+
+1997-11-18 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * iconv/gconv.h: Add __BEGIN_DECLS/__END_DECLS.
+
+1997-11-18 06:45 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/pty.c: Make thread safe. Fix bug when calling
+ again after successful call.
+ Patch by Marc Lehmann <pcg@goof.com>.
+
+1997-11-17 Paul Eggert <eggert@twinsun.com>
+
+ * time/mktime.c, time/strftime.c (_REENTRANT): #define,
+ as some hosts need this to declare localtime_r properly.
+
+1997-11-18 06:08 Ulrich Drepper <drepper@cygnus.com>
+
+ * libc.map: Add iconv_open, iconv, and iconv_close.
+
1997-11-18 02:31 Ulrich Drepper <drepper@cygnus.com>
* iconv/Makefile: New file.
diff --git a/Makerules b/Makerules
index b9c89a5a3e..53fa726aec 100644
--- a/Makerules
+++ b/Makerules
@@ -910,7 +910,7 @@ $(common-objpfx)stub-$(subdir): $(+depfiles)
(s=`cd $s; /bin/pwd`; \
$(patsubst %/,cd %;,$(objpfx)) \
sed -n 's/^stub_warning *(\([^)]*\).*$$/#define __stub_\1/p' \
- `sed -n -e '\@: $s@{; s@^.*: $s/\([a-z0-9_./-]*\.c\).*$$@'"$$s"'/\1@; h; }' \
+ `sed -n -e '\@ $s/[^ ]*\.c@{; s@^.* $s/\([^ ]*\.c\).*$$@'"$$s"'/\1@; h; }' \
-e '/stub-tag\.h/{; g; p; }' \
$(patsubst $(objpfx)%,%,$^) /dev/null` \
/dev/null) > $@T
diff --git a/README b/README
index d3439ed84b..755d4ec667 100644
--- a/README
+++ b/README
@@ -80,7 +80,7 @@ in the GNU C library, explaining how you can tell the library what
facilities you want it to make available.
We prefer to get bug reports sent using the `glibcbug' shell script which
-is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
+is install together with the rest of the GNU libc to <bugs@gnu.org>.
Simply run this shell script and fill in the information. Nevertheless
you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
electronic mails.
diff --git a/config.sub b/config.sub
index dacb4bde68..213a6d47d6 100755
--- a/config.sub
+++ b/config.sub
@@ -171,7 +171,7 @@ case $basic_machine in
exit 1
;;
# Recognize the basic CPU types with company name.
- vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+ vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
diff --git a/configure b/configure
index 31e30b0739..0fffa4b7fb 100755
--- a/configure
+++ b/configure
@@ -1636,7 +1636,7 @@ else
fi
if test "$BASH" != no &&
- $BASH -c 'test "$BASH_VERSINFO"
+ $BASH -c 'test "$BASH_VERSINFO" \
&& test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
libc_cv_have_bash2=yes
else
@@ -1946,15 +1946,19 @@ _sym:
.symver _sym,sym@VERS
EOF
cat > conftest.map <<EOF
-VERS {
+VERS_1 {
global: sym;
};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
EOF
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&5 2>&5; then
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
-nostartfiles -nostdlib
-Wl,--version-script,conftest.map
- 1>&5'; { (eval echo configure:1958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+ 1>&5'; { (eval echo configure:1962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_ld_version_script_option=yes
else
@@ -1983,9 +1987,16 @@ else
fi
+if test $VERSIONING = no; then
+ echo "\
+*** WARNING: You should not compile GNU libc without versioning. Not using
+*** versioning will introduce incompatibilities so that old binaries
+*** will not run anymore.
+*** For versioning you need recent binutils (binutils-2.8.1.0.17 or newer)."
+fi
if test $elf = yes; then
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:1989: checking for .previous assembler directive" >&5
+echo "configure:2000: checking for .previous assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1993,7 +2004,7 @@ else
.section foo_section
.previous
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1997: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_previous_directive=yes
else
libc_cv_asm_previous_directive=no
@@ -2009,7 +2020,7 @@ EOF
else
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:2013: checking for .popsection assembler directive" >&5
+echo "configure:2024: checking for .popsection assembler directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2017,7 +2028,7 @@ else
.pushsection foo_section
.popsection
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2021: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_popsection_directive=yes
else
libc_cv_asm_popsection_directive=no
@@ -2037,12 +2048,12 @@ fi
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:2041: checking for .init and .fini sections" >&5
+echo "configure:2052: checking for .init and .fini sections" >&5
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2046 "configure"
+#line 2057 "configure"
#include "confdefs.h"
int main() {
@@ -2051,7 +2062,7 @@ asm (".section .init");
asm (".text");
; return 0; }
EOF
-if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -2079,19 +2090,19 @@ if test $elf = yes; then
else
if test $ac_cv_prog_cc_works = yes; then
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2083: checking for _ prefix on C symbol names" >&5
+echo "configure:2094: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
+#line 2099 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:2095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
@@ -2106,17 +2117,17 @@ fi
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2110: checking for _ prefix on C symbol names" >&5
+echo "configure:2121: checking for _ prefix on C symbol names" >&5
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
+#line 2126 "configure"
#include "confdefs.h"
void underscore_test(void) {
return; }
EOF
-if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _underscore_test conftest* >/dev/null; then
rm -f conftest*
libc_cv_asm_underscores=yes
@@ -2149,7 +2160,7 @@ if test $elf = yes; then
libc_cv_asm_weakext_directive=no
else
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:2153: checking for assembler .weak directive" >&5
+echo "configure:2164: checking for assembler .weak directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2172,7 +2183,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:2176: checking for assembler .weakext directive" >&5
+echo "configure:2187: checking for assembler .weakext directive" >&5
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2209,7 +2220,7 @@ EOF
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2213: checking for ld --no-whole-archive" >&5
+echo "configure:2224: checking for ld --no-whole-archive" >&5
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2220,7 +2231,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&5'; { (eval echo configure:2224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
@@ -2231,7 +2242,7 @@ fi
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
-echo "configure:2235: checking for gcc -fno-exceptions" >&5
+echo "configure:2246: checking for gcc -fno-exceptions" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2242,7 +2253,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fno-exceptions
- -o conftest conftest.c 1>&5'; { (eval echo configure:2246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_no_exceptions=yes
else
libc_cv_gcc_no_exceptions=no
@@ -2253,12 +2264,12 @@ fi
echo "$ac_t""$libc_cv_gcc_no_exceptions" 1>&6
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
-echo "configure:2257: checking for DWARF2 unwind info support" >&5
+echo "configure:2268: checking for DWARF2 unwind info support" >&5
if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 2262 "configure"
+#line 2273 "configure"
static char __EH_FRAME_BEGIN__;
_start ()
{
@@ -2279,7 +2290,7 @@ __bzero () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -2337,7 +2348,7 @@ if test "$uname" = "sysdeps/generic"; then
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:2341: checking OS release for uname" >&5
+echo "configure:2352: checking OS release for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2359,7 +2370,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:2363: checking OS version for uname" >&5
+echo "configure:2374: checking OS version for uname" >&5
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2381,7 +2392,7 @@ else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:2385: checking stdio selection" >&5
+echo "configure:2396: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
@@ -2393,7 +2404,7 @@ esac
echo "$ac_t""$stdio" 1>&6
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
-echo "configure:2397: checking ldap selection" >&5
+echo "configure:2408: checking ldap selection" >&5
case $add_ons in
*ldap*)
@@ -2443,7 +2454,7 @@ if test $shared = default; then
fi
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
-echo "configure:2447: checking whether -fPIC is default" >&5
+echo "configure:2458: checking whether -fPIC is default" >&5
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
diff --git a/configure.in b/configure.in
index 0a8b2d4757..ead9e630da 100644
--- a/configure.in
+++ b/configure.in
@@ -422,7 +422,7 @@ AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_PATH_PROG(BASH, bash, no)
if test "$BASH" != no &&
- $BASH -c 'test "$BASH_VERSINFO"
+ $BASH -c 'test "$BASH_VERSINFO" \
&& test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then
libc_cv_have_bash2=yes
else
@@ -596,9 +596,13 @@ _sym:
.symver _sym,sym@VERS
EOF
cat > conftest.map <<EOF
-VERS {
+VERS_1 {
global: sym;
};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
EOF
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AC_FD_CC 2>&AC_FD_CC; then
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
@@ -627,6 +631,13 @@ else
fi
AC_SUBST(VERSIONING)
+if test $VERSIONING = no; then
+ echo "\
+*** WARNING: You should not compile GNU libc without versioning. Not using
+*** versioning will introduce incompatibilities so that old binaries
+*** will not run anymore.
+*** For versioning you need recent binutils (binutils-2.8.1.0.17 or newer)."
+fi
if test $elf = yes; then
AC_CACHE_CHECK(for .previous assembler directive,
libc_cv_asm_previous_directive, [dnl
diff --git a/db2/Makefile b/db2/Makefile
index 379d51f325..8083ee3117 100644
--- a/db2/Makefile
+++ b/db2/Makefile
@@ -19,7 +19,7 @@
#
# Sub-makefile for libdb.
#
-# The code is lifted straight from the db 2.3.10 distribution
+# The code is lifted straight from the db 2.3.12 distribution
# with minimal changes.
#
@@ -34,7 +34,7 @@ headers = db.h db_185.h
distribute = db_int.h config.h compat.h clib/getlong.c btree/btree.src \
db/db.src db185/db185_int.h hash/hash.src log/log.src \
- txn/txn.src \
+ txn/txn.src README \
$(addprefix include/,btree.h btree_auto.h btree_ext.h \
clib_ext.h common_ext.h cxx_int.h \
db.h.src db_185.h.src db_am.h db_auto.h \
@@ -43,10 +43,11 @@ distribute = db_int.h config.h compat.h clib/getlong.c btree/btree.src \
hash.h hash_auto.h hash_ext.h lock.h \
lock_ext.h log.h log_auto.h log_ext.h \
mp.h mp_ext.h mutex_ext.h os_ext.h queue.h \
- shqueue.h txn.h txn_auto.h txn_ext.h) \
+ shqueue.h txn.h txn_auto.h txn_ext.h \
+ os_func.h) \
$(addprefix mutex/,x86.gcc uts4.cc.s sparc.gcc parisc.hp \
parisc.gcc alpha.gcc alpha.dec README \
- 68020.gcc)
+ 68020.gcc tsl_parisc.s)
vpath %.c $(subdir-dirs)
diff --git a/elf/Makefile b/elf/Makefile
index e608acf416..685a027834 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -46,8 +46,6 @@ libdl-map := libdl.map
before-compile = $(objpfx)trusted-dirs.h $(objpfx)rtldtbl.h
-# We need GNU awk for the genrtldtbl.awk script.
-GAWK = gawk
all: # Make this the default target; it will be defined in Rules.
@@ -149,7 +147,7 @@ $(objpfx)trusted-dirs.h: Makefile
mv -f $@T $@
$(objpfx)rtldtbl.h: Makefile
$(make-target-directory)
- echo "$(default-rpath)" | $(GAWK) -f genrtldtbl.awk > $@T
+ echo "$(default-rpath)" | awk -f genrtldtbl.awk > $@T
mv -f $@T $@
CPPFLAGS-dl-load.c = -I$(objdir)/$(subdir)
CFLAGS-dl-load.c += -Wno-uninitialized
diff --git a/elf/dl-error.c b/elf/dl-error.c
index 5e76d7d7d8..3cfe48f5c6 100644
--- a/elf/dl-error.c
+++ b/elf/dl-error.c
@@ -80,7 +80,7 @@ _dl_signal_error (int errcode,
char buffer[1024];
_dl_sysdep_fatal (_dl_argv[0] ?: "<program name unknown>",
": error in loading shared libraries: ",
- objname ?: "", objname ? ": " : "",
+ objname ?: "", objname && *objname ? ": " : "",
errstring, errcode ? ": " : "",
(errcode
? _strerror_internal (errcode, buffer, sizeof buffer)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 0b752676b7..91b8c2a48d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -420,7 +420,7 @@ _dl_init_paths (void)
if (_dl_platform != NULL)
{
- char *tmp;
+ char *tmp, *orig;
relem->machdirnamelen = relem->dirnamelen + _dl_platformlen + 1;
tmp = (char *) malloc (relem->machdirnamelen + 1);
@@ -428,11 +428,12 @@ _dl_init_paths (void)
_dl_signal_error (ENOMEM, NULL,
"cannot create cache for search path");
- relem->dirname = tmp;
+ orig = tmp;
tmp = __mempcpy (tmp, relem->dirname, relem->dirnamelen);
tmp = __mempcpy (tmp, _dl_platform, _dl_platformlen);
*tmp++ = '/';
*tmp = '\0';
+ relem->dirname = orig;
relem->machdirstatus = unknown;
diff --git a/hesiod/Makefile b/hesiod/Makefile
index 8d0363b50d..a7e039b224 100644
--- a/hesiod/Makefile
+++ b/hesiod/Makefile
@@ -21,7 +21,7 @@
#
subdir := hesiod
-distribute := hesiod.h hesiod_p.h
+distribute := hesiod.h hesiod_p.h README.hesiod
extra-libs := libnss_hesiod
extra-libs-others = $(extra-libs)
diff --git a/iconv/gconv.c b/iconv/gconv.c
index 537d0dc3e7..0cbb052a6d 100644
--- a/iconv/gconv.c
+++ b/iconv/gconv.c
@@ -27,6 +27,7 @@ __gconv (gconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf,
size_t *outbytesleft, size_t *converted)
{
size_t last_step = cd->nsteps - 1;
+ size_t oldinbytes = *inbytesleft;
int result;
cd->data[last_step].outbuf = *outbuf;
@@ -36,9 +37,10 @@ __gconv (gconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf,
if (converted != NULL)
*converted = 0;
- result = (*cd->steps->fct) (cd->steps, cd->data, inbuf, inbytesleft,
+ result = (*cd->steps->fct) (cd->steps, cd->data, *inbuf, inbytesleft,
converted, inbuf == NULL || *inbuf == NULL);
+ *inbuf += oldinbytes - *inbytesleft;
*outbuf += cd->data[last_step].outbufavail;
*outbytesleft -= cd->data[last_step].outbufavail;
diff --git a/iconv/gconv.h b/iconv/gconv.h
index 45f3a6cf8a..2c42f99ace 100644
--- a/iconv/gconv.h
+++ b/iconv/gconv.h
@@ -24,6 +24,8 @@
#include <sys/types.h>
#include <regex.h>
+__BEGIN_DECLS
+
/* Error codes for gconv functions. */
enum
{
@@ -202,4 +204,6 @@ extern void __gconv_transform_end_rstate __P ((struct gconv_step_data *__data));
#endif
+__END_DECLS
+
#endif /* gconv.h */
diff --git a/iconv/gconv_simple.c b/iconv/gconv_simple.c
index 91a347b058..582c6f5a27 100644
--- a/iconv/gconv_simple.c
+++ b/iconv/gconv_simple.c
@@ -123,14 +123,23 @@ __gconv_transform_ucs4_utf8 (struct gconv_step *step,
data->outbufsize - data->outbufavail,
(mbstate_t *) data->data);
- /* Status so far. */
- result = GCONV_EMPTY_INPUT;
-
/* Remember how much we converted. */
do_write += newinbuf - inbuf;
*inlen -= (newinbuf - inbuf) * sizeof (wchar_t);
data->outbufavail += actually;
+
+ if (data->is_last)
+ {
+ /* This is the last step. */
+ result = (*inlen < sizeof (wchar_t)
+ ? GCONV_EMPTY_INPUT : GCONV_FULL_OUTPUT);
+ break;
+ }
+
+ /* Status so far. */
+ result = GCONV_EMPTY_INPUT;
+
if (data->outbufavail > 0)
{
/* Call the functions below in the chain. */
@@ -140,7 +149,7 @@ __gconv_transform_ucs4_utf8 (struct gconv_step *step,
written, 0);
/* Correct the output buffer. */
- if (newavail != data->outbufavail)
+ if (newavail != data->outbufavail && newavail > 0)
{
memmove (data->outbuf,
&data->outbuf[data->outbufavail - newavail],
@@ -204,14 +213,23 @@ __gconv_transform_utf8_ucs4 (struct gconv_step *step,
/ sizeof (wchar_t)),
(mbstate_t *) data->data);
- /* Status so far. */
- result = GCONV_EMPTY_INPUT;
-
/* Remember how much we converted. */
do_write += actually;
*inlen -= newinbuf - inbuf;
data->outbufavail += actually * sizeof (wchar_t);
+
+ if (data->is_last)
+ {
+ /* This is the last step. */
+ result = (data->outbufavail + sizeof (wchar_t) > data->outbufsize
+ ? GCONV_FULL_OUTPUT : GCONV_EMPTY_INPUT);
+ break;
+ }
+
+ /* Status so far. */
+ result = GCONV_EMPTY_INPUT;
+
if (data->outbufavail > 0)
{
/* Call the functions below in the chain. */
@@ -221,7 +239,7 @@ __gconv_transform_utf8_ucs4 (struct gconv_step *step,
written, 0);
/* Correct the output buffer. */
- if (newavail != data->outbufavail)
+ if (newavail != data->outbufavail && newavail > 0)
{
memmove (data->outbuf,
&data->outbuf[data->outbufavail - newavail],
@@ -236,5 +254,5 @@ __gconv_transform_utf8_ucs4 (struct gconv_step *step,
if (written != NULL && data->is_last)
*written = do_write;
- return GCONV_OK;
+ return result;
}
diff --git a/iconv/iconv_open.c b/iconv/iconv_open.c
index dadf3d9dbb..82802b7451 100644
--- a/iconv/iconv_open.c
+++ b/iconv/iconv_open.c
@@ -18,19 +18,63 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <ctype.h>
#include <errno.h>
#include <iconv.h>
+#include <string.h>
#include <gconv.h>
+static inline void
+strip (char *s)
+{
+ int slash_count = 0;
+ char *wp;
+ wp = s;
+
+ while (*s != '\0')
+ {
+ if (isalnum (*s) || *s == '_' || *s == '-' || *s == '.')
+ *wp++ = *s;
+ else if (*s == '/')
+ {
+ if (++slash_count == 2)
+ break;
+ *wp++ = '/';
+ }
+ ++s;
+ }
+
+ while (slash_count++ < 2)
+ *wp++ = '/';
+
+ *wp = '\0';
+}
+
+
iconv_t
iconv_open (const char *tocode, const char *fromcode)
{
+ char *tocode_conv;
+ char *fromcode_conv;
+ size_t tocode_len;
+ size_t fromcode_len;
gconv_t cd;
int res;
- res = __gconv_open (tocode, fromcode, &cd);
+ /* Normalize the name. We remove all characters beside alpha-numeric,
+ '_', '-', '/', and '.'. */
+ tocode_len = strlen (tocode);
+ tocode_conv = alloca (tocode_len + 3);
+ strip (memcpy (tocode_conv, tocode, tocode_len + 1));
+
+ fromcode_len = strlen (fromcode);
+ fromcode_conv = alloca (fromcode_len + 3);
+ strip (memcpy (fromcode_conv, fromcode, fromcode_len + 1));
+
+ res = __gconv_open (tocode_conv[2] == '\0' ? tocode : tocode_conv,
+ fromcode_conv[2] == '\0' ? fromcode, fromcode_conv, &cd);
if (res != GCONV_OK)
{
diff --git a/libc.map b/libc.map
index 3e6b7097f1..81954cbb49 100644
--- a/libc.map
+++ b/libc.map
@@ -13,6 +13,8 @@ GLIBC_2.0 {
_obstack;
__progname_full; __progname;
+ _IO_list_all; _IO_stderr_; _IO_stdin_; _IO_stdout_;
+
# This is for ix86 only.
_fp_hw;
@@ -23,14 +25,15 @@ GLIBC_2.0 {
__sigsetjmp; _setjmp; __sigaddset; __sigdelset; __sigismember;
__sysv_signal; __bsd_getpgrp; _longjmp; _mcount;
__divqu; __remqu; __divqs; __remqs; __divlu; __remlu; __divls;
- __remls;
+ __remls; __divl; __reml; __divq; __remq; __divqu; __remqu;
# functions which have an additional interface since they are
# are cancelable.
__libc_wait; __libc_waitpid; __libc_pause; __libc_nanosleep;
__libc_open; __libc_close; __libc_read; __libc_write;
__libc_lseek; __libc_fcntl; __libc_tcdrain; __libc_fsync;
- __libc_msync; __libc_system;
+ __libc_msync; __libc_system; __libc_accept; __libc_send; __libc_recvfrom;
+ __libc_recvmsg; __libc_sendmsg; __libc_recv; __libc_sendto; __libc_connect;
# interface of malloc functions
__libc_calloc; __libc_free; __libc_mallinfo; __libc_malloc;
@@ -87,6 +90,7 @@ GLIBC_2.0 {
_IO_str_underflow; _IO_str_init_static; _IO_str_init_readonly;
_IO_str_seekoff; _IO_str_pbackfail; _IO_file_jumps;
_IO_peekc_locked; _IO_flockfile; _IO_funlockfile;
+ _IO_fopen; _IO_fclose;
__vsscanf; __vfscanf; __vsnprintf;
_rpc_dtablesize; _null_auth; _seterr_reply;
__res_randomid;
@@ -177,9 +181,9 @@ GLIBC_2.0 {
ferror_unlocked; fexecve; fflush; fflush_unlocked; ffs; fgetc;
fgetgrent; fgetgrent_r; fgetpos; fgetpos64; fgetpwent; fgetpwent_r; fgets;
fgetspent; fgetspent_r; fileno; fileno_unlocked; finite; finitef;
- finitel; flock; flockfile; fmtmsg; fnmatch; fopen64; fopencookie;
+ finitel; flock; flockfile; fmtmsg; fnmatch; fopen; fopen64; fopencookie;
fork; fpathconf; fprintf; fputc; fputc_unlocked; fputs; fread; free;
- freeaddrinfo; freopen64; frexp; frexpf; frexpl; fscanf; fseek;
+ freeaddrinfo; freopen; freopen64; frexp; frexpf; frexpl; fscanf; fseek;
fseeko; fseeko64; fsetpos; fsetpos64; fstatfs; fstatfs64; fsync; ftell;
ftello; ftello64; ftime; ftok; ftruncate; ftruncate64; ftrylockfile;
fts_children; fts_close; fts_open; fts_read; fts_set; ftw; ftw64;
@@ -226,7 +230,8 @@ GLIBC_2.0 {
inet6_isipv4mapped; inet_addr; inet_aton; inet_lnaof; inet_makeaddr;
inet_netof; inet_network; inet_nsap_addr; inet_nsap_ntoa; inet_ntoa;
inet_ntop; inet_pton; init_module; initgroups; initstate; initstate_r;
- innetgr; insque; ioctl; ioperm; iopl; iruserok;
+ innetgr; insque; ioctl; ioperm; iopl; iruserok; iconv_open; iconv;
+ iconv_close;
isalnum; isalpha; isascii; isatty; isblank; iscntrl; isdigit;
isfdtype; isgraph; isinf; isinff; isinfl; islower; isnan; isnanf;
@@ -413,17 +418,19 @@ GLIBC_2.0 {
xdrrec_endofrecord; xdrrec_eof; xdrrec_skiprecord; xdrstdio_create;
xencrypt; xprt_register; xprt_unregister;
- _IO_list_all;
-
- _IO_stdin_; _IO_stdout_; _IO_stderr_;
- _IO_fopen; fopen; freopen; _IO_fclose; fclose;
-
local:
*;
};
GLIBC_2.1 {
global:
- _IO_fopen; fopen; _IO_fclose; fclose;
+ # global variables
_IO_2_1_stdin_; _IO_2_1_stdout_; _IO_2_1_stderr_;
+
+ # functions used in other libraries
+ _IO_fclose; _IO_fopen;
+
+ # functions in normal name space
+ fopen; fclose;
+
} GLIBC_2.0;
diff --git a/libio/iofprintf.c b/libio/iofprintf.c
deleted file mode 100644
index 4dc9d3f661..0000000000
--- a/libio/iofprintf.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
- This file is part of the GNU IO Library.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This 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
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this library; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
-
- As a special exception, if you link this library with files
- compiled with a GNU compiler to produce an executable, this does
- not cause the resulting executable to be covered by the GNU General
- Public License. This exception does not however invalidate any
- other reasons why the executable file might be covered by the GNU
- General Public License. */
-
-#include "libioP.h"
-
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-int
-#ifdef __STDC__
-_IO_fprintf (_IO_FILE *fp, const char* format, ...)
-#else
-_IO_fprintf (fp, format, va_alist)
- _IO_FILE *fp;
- char *format;
- va_dcl
-#endif
-{
- int ret;
- va_list args;
- CHECK_FILE (fp, -1);
- _IO_va_start (args, format);
- ret = _IO_vfprintf (fp, format, args);
- va_end (args);
- return ret;
-}
diff --git a/libio/iolibio.h b/libio/iolibio.h
index c1a9184305..1eef384fa8 100644
--- a/libio/iolibio.h
+++ b/libio/iolibio.h
@@ -8,6 +8,8 @@ extern "C" {
#endif
extern int _IO_fclose __P((_IO_FILE*));
+extern int _IO_new_fclose __P((_IO_FILE*));
+extern int _IO_old_fclose __P((_IO_FILE*));
extern _IO_FILE *_IO_fdopen __P((int, const char*));
extern int _IO_fflush __P((_IO_FILE*));
extern int _IO_fgetpos __P((_IO_FILE*, _IO_fpos_t*));
diff --git a/libio/iopopen.c b/libio/iopopen.c
index 65337f8f28..a03cf636b2 100644
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -98,18 +98,23 @@ _IO_proc_open (fp, command, mode)
return NULL;
if (_IO_pipe (pipe_fds) < 0)
return NULL;
- if (mode[0] == 'r')
+ if (mode[0] == 'r' && mode[1] == '\0')
{
parent_end = pipe_fds[0];
child_end = pipe_fds[1];
read_or_write = _IO_NO_WRITES;
}
- else
+ else if (mode[0] == 'w' && mode[1] == '\0')
{
parent_end = pipe_fds[1];
child_end = pipe_fds[0];
read_or_write = _IO_NO_READS;
}
+ else
+ {
+ __set_errno (EINVAL);
+ return NULL;
+ }
((_IO_proc_file *) fp)->pid = child_pid = _IO_fork ();
if (child_pid == 0)
{
diff --git a/malloc/malloc.c b/malloc/malloc.c
index e5c3c64b15..7f80b9ad60 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -3761,6 +3761,9 @@ malloc_update_mallinfo(ar_ptr, mi) arena *ar_ptr; struct mallinfo *mi;
#endif
INTERNAL_SIZE_T avail;
+ /* Initialize the memory. */
+ memset (mi, '\0', sizeof (struct mallinfo));
+
(void)mutex_lock(&ar_ptr->mutex);
avail = chunksize(top(ar_ptr));
navail = ((long)(avail) >= (long)MINSIZE)? 1 : 0;
diff --git a/manual/Makefile b/manual/Makefile
index cda84f7bec..3546841118 100644
--- a/manual/Makefile
+++ b/manual/Makefile
@@ -103,7 +103,8 @@ distribute = $(minimal-dist) \
$(minimal-dist))) \
libc.info* libc.?? libc.??s texinfo.tex summary.texi \
stamp-summary chapters chapters-incl1 chapters-incl2 \
- xtract-typefun.awk dir-add.texi dir-add.info dir
+ xtract-typefun.awk dir-add.texi dir-add.info dir \
+ stdio-fp.c
export distribute := $(distribute)
tar-it = tar chovf $@ $^
diff --git a/manual/arith.texi b/manual/arith.texi
index 07833931fd..3e153fcfa7 100644
--- a/manual/arith.texi
+++ b/manual/arith.texi
@@ -151,7 +151,6 @@ problem.
@deftypevr Macro {const float imaginary} _Imaginary_I
This macro is a representation of the value ``@math{1i}''. I.e., it is
the value for which
-@end deftypevr
@smallexample
_Imaginary_I * _Imaginary_I = -1
@@ -164,6 +163,7 @@ One can use it to easily construct complex number like in
@smallexample
3.0 - _Imaginary_I * 4.0
@end smallexample
+@end deftypevr
@noindent
which results in the complex number with a real part of 3.0 and a
diff --git a/manual/maint.texi b/manual/maint.texi
index e2a6b34ae2..7cb735534d 100644
--- a/manual/maint.texi
+++ b/manual/maint.texi
@@ -189,7 +189,7 @@ build the GNU C library:
@itemize @bullet
@item
-@code{make} 3.75
+GNU @code{make} 3.75
You need the latest version of GNU @code{make}. Modifying the GNU C
Library to work with other @code{make} programs would be so hard that we
@@ -209,7 +209,7 @@ On PowerPC, GCC versions dated earlier than 970904 are known not to work
(they crash), including 2.7.2.
@item
-@code{binutils} 2.8.1
+GNU @code{binutils} 2.8.1.0.17
Using the GNU @code{binutils} (assembler, linker, and related tools) is
preferable when possible, and they are required to build an ELF shared C
@@ -217,7 +217,7 @@ library. We recommend @code{binutils} version 2.8.1 or later; earlier
versions are known to have problems or to not support all architectures.
@item
-@code{texinfo} 3.11
+GNU @code{texinfo} 3.11
To correctly translate and install the Texinfo documentation you need
this version of the @code{texinfo} package. Former versions did not
@@ -236,7 +236,7 @@ If you change any configuration file you will need also
@itemize @bullet
@item
-@code{autoconf} 2.12
+GNU @code{autoconf} 2.12
@end itemize
@noindent
@@ -247,6 +247,13 @@ and if you change any of the message translation files you will also need
@code{GNU gettext} 0.10 or later
@end itemize
+If any of the manual files changed you will need this
+
+@itemize @bullet
+@item
+GNU @code{awk} 3.0
+@end itemize
+
@noindent
If you upgrade your source tree using the patches made available you probably
will need those package above in any case.
diff --git a/math/libm-test.c b/math/libm-test.c
index 0486718b8a..b7f265c038 100644
--- a/math/libm-test.c
+++ b/math/libm-test.c
@@ -35,14 +35,15 @@
PRINTF_EXPR Floating point conversion specification to print a variable
of type MATHTYPE with printf. PRINTF_EXPR just contains
the specifier, not the percent and width arguments,
- e.g. "f"
+ e.g. "f".
+ PRINTF_XEXPR Like PRINTF_EXPR, but print in hexadecimal format.
*/
/* This program isn't finished yet.
It has tests for:
acos, acosh, asin, asinh, atan, atan2, atanh,
cbrt, ceil, copysign, cos, cosh, erf, erfc, exp, exp2, expm1,
- fabs, fdim, floor, fmin, fmax, fmod, fpclassify,
+ fabs, fdim, floor, fma, fmax, fmin, fmod, fpclassify,
frexp, gamma, hypot,
ilogb, isfinite, isinf, isnan, isnormal,
ldexp, lgamma, log, log10, log1p, log2, logb,
@@ -137,7 +138,9 @@
/* Various constants (we must supply them precalculated for accuracy). */
#define M_PI_6 .52359877559829887308L
-static int noErrors;
+static int noErrors; /* number of errors */
+static int noTests; /* number of tests (without testing exceptions) */
+static int noExcTests; /* number of tests for exception flags */
static int verbose = 3;
static MATHTYPE minus_zero, plus_zero;
@@ -302,6 +305,7 @@ test_single_exception (const char *test_name,
static void
test_not_exception (const char *test_name, short int exception)
{
+ ++noExcTests;
#ifdef FE_DIVBYZERO
if ((exception & DIVIDE_BY_ZERO_EXCEPTION) == 0)
test_single_exception (test_name, exception,
@@ -321,6 +325,7 @@ test_not_exception (const char *test_name, short int exception)
static void
test_exceptions (const char *test_name, short int exception)
{
+ ++noExcTests;
#ifdef FE_DIVBYZERO
test_single_exception (test_name, exception,
DIVIDE_BY_ZERO_EXCEPTION, FE_DIVBYZERO,
@@ -364,6 +369,7 @@ check_equal (MATHTYPE computed, MATHTYPE supplied, MATHTYPE eps, MATHTYPE * diff
static void
output_result_bool (const char *test_name, int result)
{
+ ++noTests;
if (result)
{
output_pass_value ();
@@ -384,6 +390,7 @@ static void
output_isvalue (const char *test_name, int result,
MATHTYPE value)
{
+ ++noTests;
if (result)
{
output_pass_value ();
@@ -392,8 +399,9 @@ output_isvalue (const char *test_name, int result,
{
output_fail_value (test_name);
if (verbose > 1)
- printf (" Value: %.20" PRINTF_EXPR "\n", value);
- noErrors++;
+ printf (" Value: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ value, value);
+ ++noErrors;
}
fpstack_test (test_name);
@@ -404,6 +412,7 @@ static void
output_isvalue_ext (const char *test_name, int result,
MATHTYPE value, MATHTYPE parameter)
{
+ ++noTests;
if (result)
{
output_pass_value ();
@@ -413,8 +422,10 @@ output_isvalue_ext (const char *test_name, int result,
output_fail_value (test_name);
if (verbose > 1)
{
- printf (" Value: %.20" PRINTF_EXPR "\n", value);
- printf (" Parameter: %.20" PRINTF_EXPR "\n", parameter);
+ printf (" Value: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ value, value);
+ printf (" Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ parameter, parameter);
}
noErrors++;
}
@@ -429,6 +440,7 @@ output_result (const char *test_name, int result,
MATHTYPE difference,
int print_values, int print_diff)
{
+ ++noTests;
if (result)
{
output_pass_value ();
@@ -439,12 +451,15 @@ output_result (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: %.20" PRINTF_EXPR "\n", computed);
- printf (" should be: %.20" PRINTF_EXPR "\n", expected);
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ computed, computed);
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ expected, expected);
if (print_diff)
- printf (" difference: %.20" PRINTF_EXPR "\n", difference);
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ "\n", difference, difference);
}
- noErrors++;
+ ++noErrors;
}
fpstack_test (test_name);
@@ -458,6 +473,7 @@ output_result_ext (const char *test_name, int result,
MATHTYPE parameter,
int print_values, int print_diff)
{
+ ++noTests;
if (result)
{
output_pass_value ();
@@ -468,13 +484,17 @@ output_result_ext (const char *test_name, int result,
if (verbose > 1 && print_values)
{
printf ("Result:\n");
- printf (" is: %.20" PRINTF_EXPR "\n", computed);
- printf (" should be: %.20" PRINTF_EXPR "\n", expected);
+ printf (" is: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ computed, computed);
+ printf (" should be: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ expected, expected);
if (print_diff)
- printf (" difference: %.20" PRINTF_EXPR "\n", difference);
- printf ("Parameter: %.20" PRINTF_EXPR "\n", parameter);
+ printf (" difference: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR
+ "\n", difference, difference);
+ printf ("Parameter: % .20" PRINTF_EXPR " % .20" PRINTF_XEXPR "\n",
+ parameter, parameter);
}
- noErrors++;
+ ++noErrors;
}
fpstack_test (test_name);
@@ -605,6 +625,7 @@ check_long (const char *test_name, long int computed, long int expected)
long int diff = computed - expected;
int result = diff == 0;
+ ++noTests;
output_new_test (test_name);
test_exceptions (test_name, NO_EXCEPTION);
@@ -637,6 +658,7 @@ check_longlong (const char *test_name, long long int computed,
long long int diff = computed - expected;
int result = diff == 0;
+ ++noTests;
output_new_test (test_name);
test_exceptions (test_name, NO_EXCEPTION);
@@ -1165,9 +1187,14 @@ check_frexp (const char *test_name, MATHTYPE computed, MATHTYPE expected,
if (verbose > 1)
{
printf ("Result:\n");
- printf (" is: %.20" PRINTF_EXPR " *2^%d\n", computed, comp_int);
- printf (" should be: %.20" PRINTF_EXPR " *2^%d\n", expected, exp_int);
- printf (" difference: %.20" PRINTF_EXPR "\n", diff);
+ printf (" is: %.20" PRINTF_EXPR " *2^%d %.20"
+ PRINTF_XEXPR "*2^%d\n",
+ computed, comp_int, computed, comp_int);
+ printf (" should be: %.20" PRINTF_EXPR " *2^%d %.20"
+ PRINTF_XEXPR "*2^%d\n",
+ expected, exp_int, expected, exp_int);
+ printf (" difference: %.20" PRINTF_EXPR " %.20" PRINTF_XEXPR "\n",
+ diff, diff);
}
noErrors++;
}
@@ -5261,11 +5288,14 @@ main (int argc, char *argv[])
identities ();
inverse_functions ();
+ printf ("\nTest suite completed:\n");
+ printf (" %d test cases plus %d tests for exception flags executed.\n",
+ noTests, noExcTests);
if (noErrors)
{
- printf ("\n%d errors occured.\n", noErrors);
+ printf (" %d errors occured.\n", noErrors);
exit (1);
}
- printf ("\n All tests passed successfully.\n");
+ printf (" All tests passed successfully.\n");
exit (0);
}
diff --git a/math/test-double.c b/math/test-double.c
index c2e7dc92b3..4769f4e754 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -23,6 +23,7 @@
#define MATHCONST(x) x
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cdouble
#define PRINTF_EXPR "e"
+#define PRINTF_XEXPR "a"
#define TEST_DOUBLE 1
#ifndef __NO_MATH_INLINES
diff --git a/math/test-float.c b/math/test-float.c
index 849067c8da..04027738a9 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -23,6 +23,7 @@
#define MATHCONST(x) x
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cfloat
#define PRINTF_EXPR "e"
+#define PRINTF_XEXPR "a"
#define TEST_FLOAT 1
#ifndef __NO_MATH_INLINES
diff --git a/math/test-idouble.c b/math/test-idouble.c
index 3039ccf5b4..14bfb9241e 100644
--- a/math/test-idouble.c
+++ b/math/test-idouble.c
@@ -24,6 +24,7 @@
#define MATHCONST(x) x
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cdouble
#define PRINTF_EXPR "e"
+#define PRINTF_XEXPR "a"
#define TEST_DOUBLE 1
#define TEST_INLINE
diff --git a/math/test-ifloat.c b/math/test-ifloat.c
index d6f96f8622..a45a54d335 100644
--- a/math/test-ifloat.c
+++ b/math/test-ifloat.c
@@ -23,6 +23,7 @@
#define MATHCONST(x) x
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Cfloat
#define PRINTF_EXPR "e"
+#define PRINTF_XEXPR "a"
#define TEST_FLOAT 1
#define TEST_INLINE 1
diff --git a/math/test-ildoubl.c b/math/test-ildoubl.c
index 791cb95cf3..3947cf14cf 100644
--- a/math/test-ildoubl.c
+++ b/math/test-ildoubl.c
@@ -24,6 +24,7 @@
#define MATHCONST(x) x##L
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Clongdouble
#define PRINTF_EXPR "Le"
+#define PRINTF_XEXPR "La"
#define TEST_INLINE
#ifdef __NO_MATH_INLINES
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index eb9b57ae96..c516c973ba 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -23,6 +23,7 @@
#define MATHCONST(x) x##L
#define CHOOSE(Clongdouble,Cdouble,Cfloat) Clongdouble
#define PRINTF_EXPR "Le"
+#define PRINTF_XEXPR "La"
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
index c57396f98b..eaae77a8d5 100644
--- a/stdio-common/printf_fphex.c
+++ b/stdio-common/printf_fphex.c
@@ -166,7 +166,7 @@ __printf_fphex (FILE *fp,
if (__isinfl (fpnum.ldbl.d))
special = isupper (info->spec) ? "INF" : "inf";
- negative = fpnum.ldbl.d < 0;
+ negative = signbit (fpnum.ldbl.d);
}
}
else
@@ -184,7 +184,7 @@ __printf_fphex (FILE *fp,
if (__isinf (fpnum.dbl.d))
special = isupper (info->spec) ? "INF" : "inf";
- negative = fpnum.dbl.d < 0;
+ negative = signbit (fpnum.dbl.d);
}
}
diff --git a/stdio-common/test-popen.c b/stdio-common/test-popen.c
index 426da4a24c..b13a1c2542 100644
--- a/stdio-common/test-popen.c
+++ b/stdio-common/test-popen.c
@@ -82,6 +82,21 @@ main (void)
remove ("/tmp/tstpopen.tmp");
+ errno = 0;
+ output = popen ("/bin/cat", "m");
+ if (output != NULL)
+ {
+ puts ("popen called with illegal mode does not return NULL");
+ puts ("Test FAILED!");
+ exit (1);
+ }
+ if (errno != EINVAL)
+ {
+ puts ("popen called with illegal mode does not set errno to EINVAL");
+ puts ("Test FAILED!");
+ exit (1);
+ }
+
puts (wstatus | rstatus ? "Test FAILED!" : "Test succeeded.");
exit (wstatus | rstatus);
}
diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
index b9fc87679b..9f8eba9c4c 100644
--- a/stdio-common/vfscanf.c
+++ b/stdio-common/vfscanf.c
@@ -434,6 +434,13 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
flags |= LONGDBL;
break;
case 'a':
+ /* The `a' is used as a flag only if followed by `s', `S' or
+ `['. */
+ if (*f != 's' && *f != 'S' && *f != '[')
+ {
+ --f;
+ break;
+ }
if (flags & TYPEMOD)
/* Signal illegal format element. */
conv_error ();
@@ -917,6 +924,7 @@ __vfscanf (FILE *s, const char *format, va_list argptr)
case 'f':
case 'g':
case 'G':
+ case 'a':
case 'A':
c = inchar ();
if (c == EOF)
diff --git a/stdlib/strtod.c b/stdlib/strtod.c
index cd78ef0df4..e93ec9add2 100644
--- a/stdlib/strtod.c
+++ b/stdlib/strtod.c
@@ -793,26 +793,20 @@ INTERNAL (STRTOF) (nptr, endptr, group LOCALE_PARAM)
val = 10 + TOLOWER (*startp++) - L_('a');
bits = nbits[val];
- if (pos + 1 >= 4)
+ if (pos + 1 >= 4 || pos + 1 >= bits)
{
/* We don't have to care for wrapping. This is the normal
- case so we add this optimization. */
+ case so we add the first clause in the `if' expression as
+ an optimization. It is a compile-time constant and so does
+ not cost anything. */
retval[idx] = val << (pos - bits + 1);
pos -= bits;
}
else
{
- if (pos + 1 >= bits)
- {
- retval[idx] = val << (pos - bits + 1);
- pos -= bits;
- }
- else
- {
- retval[idx--] = val >> (bits - pos - 1);
- retval[idx] = val << (BITS_PER_MP_LIMB - (bits - pos - 1));
- pos = BITS_PER_MP_LIMB - 1 - (bits - pos - 1);
- }
+ retval[idx--] = val >> (bits - pos - 1);
+ retval[idx] = val << (BITS_PER_MP_LIMB - (bits - pos - 1));
+ pos = BITS_PER_MP_LIMB - 1 - (bits - pos - 1);
}
while (--dig_no > 0 && idx >= 0)
diff --git a/sysdeps/generic/pty.c b/sysdeps/generic/pty.c
index 660602b25a..75c7857f47 100644
--- a/sysdeps/generic/pty.c
+++ b/sysdeps/generic/pty.c
@@ -49,6 +49,10 @@ static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93";
#include <pty.h>
#include <utmp.h>
+#ifndef REVOKE
+# define REVOKE(Line) revoke (Line)
+#endif
+
int
openpty(amaster, aslave, name, termp, winp)
int *amaster, *aslave;
@@ -56,7 +60,7 @@ openpty(amaster, aslave, name, termp, winp)
struct termios *termp;
struct winsize *winp;
{
- static char line[] = "/dev/ptyXX";
+ char line[11];
register const char *cp1, *cp2;
register int master, slave, ttygid;
size_t buflen = sysconf (_SC_GETGR_R_SIZE_MAX);
@@ -64,6 +68,8 @@ openpty(amaster, aslave, name, termp, winp)
struct group grbuffer;
struct group *gr;
+ strcpy (line, "/dev/ptyXX");
+
if (getgrnam_r("tty", &grbuffer, buffer, buflen, &gr) >= 0)
ttygid = gr->gr_gid;
else
@@ -80,7 +86,7 @@ openpty(amaster, aslave, name, termp, winp)
line[5] = 't';
(void) chown(line, getuid(), ttygid);
(void) chmod(line, S_IRUSR|S_IWUSR|S_IWGRP);
- (void) revoke(line);
+ REVOKE(line);
if ((slave = open(line, O_RDWR, 0)) != -1) {
*amaster = master;
*aslave = slave;
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
new file mode 100644
index 0000000000..cdfeb2cb81
--- /dev/null
+++ b/sysdeps/generic/sys/ucontext.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 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 _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#error "No system dependent context structure definitions"
+
+#endif /* sys/ucontext.h */
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index bb2d8f7b41..b97f95f6a8 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -1,6 +1,6 @@
# The mpn functions need a #define for asm syntax flavor.
# Every i386 port in use uses gas syntax (I think).
-asm-CPPFLAGS := $(asm-CPPFLAGS) -DGAS_SYNTAX
+asm-CPPFLAGS += -DGAS_SYNTAX
# The i386 `long double' is a distinct type we support.
long-double-fcts = yes
@@ -18,3 +18,7 @@ CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
CFLAGS-dl-load.c += -Wno-unused
CFLAGS-dl-reloc.c += -Wno-unused
endif
+
+ifeq ($(subdir),math)
+CPPFLAGS += -D__LIBC_INTERNAL_MATH_INLINES
+endif
diff --git a/sysdeps/i386/fpu/bits/mathinline.h b/sysdeps/i386/fpu/bits/mathinline.h
index 482b47e3b3..5823055c30 100644
--- a/sysdeps/i386/fpu/bits/mathinline.h
+++ b/sysdeps/i386/fpu/bits/mathinline.h
@@ -22,64 +22,123 @@
# error "Never use <bits/mathinline.h> directly; include <math.h> instead."
#endif
+#ifdef __cplusplus
+# define __MATH_INLINE __inline
+#else
+# define __MATH_INLINE extern __inline
+#endif
+
#if defined __USE_ISOC9X && defined __GNUC__ && __GNUC__ >= 2
/* ISO C 9X defines some macros to perform unordered comparisons. The
ix87 FPU supports this with special opcodes and we should use them.
These must not be inline functions since we have to be able to handle
all floating-point types. */
-# define isgreater(x, y) \
+# ifdef __i686__
+/* For the PentiumPro and more recent processors we can provide
+ better code. */
+# define isgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; seta %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# define isgreaterequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; setae %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isless(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; setb %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define islessequal(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; setbe %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define islessgreater(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; setne %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+
+# define isunordered(x, y) \
+ ({ register char __result; \
+ __asm__ ("fucomip; setp %%al" \
+ : "=a" (__result) : "u" (y), "t" (x) : "cc", "st"); \
+ __result; })
+# else
+/* This is the dumb, portable code for i386 and above. */
+# define isgreater(x, y) \
({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al;" \
+ __asm__ ("fucompp; fnstsw; testb $0x45, %%ah; setz %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-# define isgreaterequal(x, y) \
+# define isgreaterequal(x, y) \
({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al;" \
+ __asm__ ("fucompp; fnstsw; testb $0x05, %%ah; setz %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-# define isless(x, y) \
+# define isless(x, y) \
({ register char __result; \
- __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x45, %%ah;" \
- "setz %%al" \
+ __asm__ ("fucompp; fnstsw; sahf; setb %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-# define islessequal(x, y) \
+# define islessequal(x, y) \
({ register char __result; \
- __asm__ ("fucompp; fnstsw; xorb $0x01, %%ah; testb $0x05, %%ah;" \
- "setz %%al" \
+ __asm__ ("fucompp; fnstsw; sahf; setbe %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-# define islessgreater(x, y) \
+# define islessgreater(x, y) \
({ register char __result; \
- __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al;" \
+ __asm__ ("fucompp; fnstsw; testb $0x44, %%ah; setz %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-# define isunordered(x, y) \
+# define isunordered(x, y) \
({ register char __result; \
__asm__ ("fucompp; fnstsw; sahf; setp %%al" \
: "=a" (__result) : "u" (y), "t" (x) : "cc", "st", "st(1)"); \
__result; })
-#endif
+# endif /* __i686__ */
+/* XXX Argh!!! More compiler errors. */
+#if 0
+/* Test for negative number. Used in the signbit() macro. */
+__MATH_INLINE int
+__signbitf (float __x)
+{
+ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0;
+}
+__MATH_INLINE int
+__signbit (double __x)
+{
+ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[1] < 0;
+}
+__MATH_INLINE int
+__signbitl (long double __x)
+{
+ union { long double __l; int __i[3]; } __u = { __l: __x };
+ return (__u.__i[2] & 0x8000) != 0;
+}
+#endif
+#endif
-#ifdef __GNUC__
-#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* The gcc, version 2.7 or below, has problems with all this inlining
code. So disable it for this version of the compiler. */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7)
+#if defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 7))
-#ifdef __cplusplus
-# define __MATH_INLINE __inline
-#else
-# define __MATH_INLINE extern __inline
-#endif
+#if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
+ && defined __OPTIMIZE__)
/* A macro to define float, double, and long double versions of various
math functions for the ix87 FPU. FUNC is the function name (which will
@@ -163,8 +222,10 @@
{ \
code; \
}
+#endif
+#if !defined __NO_MATH_INLINES && defined __OPTIMIZE__
/* Miscellaneous functions */
__inline_mathcode (__sgn, __x, \
@@ -550,6 +611,16 @@ __inline_mathcode (__acosh1p, __x, \
#undef __atan2_code
#undef __sincos_code
-#endif /* Not gcc <= 2.7. */
#endif /* __NO_MATH_INLINES */
+
+
+/* This code is used internally in the GNU libc. */
+#if 0
+/* XXX I hate compiler bugs. The current version produces wrong code
+ if this optimization is used. */
+#ifdef __LIBC_INTERNAL_MATH_INLINES
+__inline_mathop (__ieee754_sqrt, "fsqrt")
+#endif
+#endif
+
#endif /* __GNUC__ */
diff --git a/sysdeps/ieee754/bits/nan.h b/sysdeps/ieee754/bits/nan.h
index 05a9d6af2a..1f385ffc00 100644
--- a/sysdeps/ieee754/bits/nan.h
+++ b/sysdeps/ieee754/bits/nan.h
@@ -42,7 +42,7 @@
# define __nan_bytes { 0, 0, 0xc0, 0x7f }
# endif
-static union { unsigned char __c[4]; double __d; } __nan = { __nan_bytes };
+static union { unsigned char __c[4]; float __d; } __nan = { __nan_bytes };
# define NAN (__nan.__d)
#endif /* GCC. */
diff --git a/sysdeps/libm-ieee754/s_remquo.c b/sysdeps/libm-ieee754/s_remquo.c
index 39f6ceab2e..6e32efbba2 100644
--- a/sysdeps/libm-ieee754/s_remquo.c
+++ b/sysdeps/libm-ieee754/s_remquo.c
@@ -71,11 +71,6 @@ __remquo (double x, double y, int *quo)
x -= 2 * y;
cquo += 2;
}
- if (x >= y)
- {
- x -= y;
- ++cquo;
- }
if (hy < 0x00200000)
{
diff --git a/sysdeps/libm-ieee754/s_remquof.c b/sysdeps/libm-ieee754/s_remquof.c
index b3870f4b02..2ffd16c903 100644
--- a/sysdeps/libm-ieee754/s_remquof.c
+++ b/sysdeps/libm-ieee754/s_remquof.c
@@ -70,11 +70,6 @@ __remquof (float x, float y, int *quo)
x -= 2 * y;
cquo += 2;
}
- if (x >= y)
- {
- x -= y;
- ++cquo;
- }
if (hy < 0x01000000)
{
diff --git a/sysdeps/libm-ieee754/s_remquol.c b/sysdeps/libm-ieee754/s_remquol.c
index b7835e6dc7..88ff298eb6 100644
--- a/sysdeps/libm-ieee754/s_remquol.c
+++ b/sysdeps/libm-ieee754/s_remquol.c
@@ -71,11 +71,6 @@ __remquol (long double x, long double p, int *quo)
x -= 2 * p;
cquo += 2;
}
- if (x >= p)
- {
- x -= p;
- ++cquo;
- }
if (ep < 0x0002)
{
diff --git a/sysdeps/m68k/fpu/bits/mathinline.h b/sysdeps/m68k/fpu/bits/mathinline.h
index c3ed76c0de..827a8d603d 100644
--- a/sysdeps/m68k/fpu/bits/mathinline.h
+++ b/sysdeps/m68k/fpu/bits/mathinline.h
@@ -70,22 +70,22 @@
#if (!defined __NO_MATH_INLINES && defined __OPTIMIZE__) \
- || defined __LIBC_M81_MATH_INLINES
+ || defined __LIBC_INTERNAL_MATH_INLINES
-#ifdef __LIBC_M81_MATH_INLINES
+#ifdef __LIBC_INTERNAL_MATH_INLINES
/* This is used when defining the functions themselves. Define them with
__ names, and with `static inline' instead of `extern inline' so the
bodies will always be used, never an external function call. */
-#define __m81_u(x) __CONCAT(__,x)
-#define __m81_inline static __inline
+# define __m81_u(x) __CONCAT(__,x)
+# define __m81_inline static __inline
#else
-#define __m81_u(x) x
-#ifdef __cplusplus
-#define __m81_inline __inline
-#else
-#define __m81_inline extern __inline
-#endif
-#define __M81_MATH_INLINES 1
+# define __m81_u(x) x
+# ifdef __cplusplus
+# define __m81_inline __inline
+# else
+# define __m81_inline extern __inline
+# endif
+# define __M81_MATH_INLINES 1
#endif
/* Define a const math function. */
@@ -99,12 +99,12 @@
is the name of the fpu operation (without leading f). */
#if defined __USE_MISC || defined __USE_ISOC9X
-#define __inline_mathop(func, op) \
+# define __inline_mathop(func, op) \
__inline_mathop1(double, func, op) \
__inline_mathop1(float, __CONCAT(func,f), op) \
__inline_mathop1(long double, __CONCAT(func,l), op)
#else
-#define __inline_mathop(func, op) \
+# define __inline_mathop(func, op) \
__inline_mathop1(double, func, op)
#endif
@@ -116,7 +116,7 @@
return __result; \
}
-#ifdef __LIBC_M81_MATH_INLINES
+#ifdef __LIBC_INTERNAL_MATH_INLINES
/* ieee style elementary functions */
/* These are internal to the implementation of libm. */
__inline_mathop(__ieee754_acos, acos)
@@ -154,21 +154,21 @@ __inline_mathop(sin, sin)
__inline_mathop(tan, tan)
__inline_mathop(tanh, tanh)
-#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
+# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC9X
__inline_mathop(rint, int)
__inline_mathop(expm1, etoxm1)
__inline_mathop(log1p, lognp1)
-#endif
+# endif
-#ifdef __USE_MISC
+# ifdef __USE_MISC
__inline_mathop(significand, getman)
-#endif
+# endif
-#ifdef __USE_ISOC9X
+# ifdef __USE_ISOC9X
__inline_mathop(log2, log2)
__inline_mathop(exp2, twotox)
__inline_mathop(trunc, intrz)
-#endif
+# endif
#endif /* !__NO_MATH_INLINES && __OPTIMIZE__ */
@@ -176,9 +176,9 @@ __inline_mathop(trunc, intrz)
functions, using __FLOAT_TYPE as the domain type and __S as the suffix
for the function names. */
-#ifdef __LIBC_M81_MATH_INLINES
+#ifdef __LIBC_INTERNAL_MATH_INLINES
/* Internally used functions. */
-#define __internal_inline_functions(float_type, s) \
+# define __internal_inline_functions(float_type, s) \
__m81_defun (float_type, __CONCAT(__ieee754_remainder,s), \
(float_type __x, float_type __y)) \
{ \
@@ -198,7 +198,7 @@ __m81_defun (float_type, __CONCAT(__ieee754_fmod,s), \
__internal_inline_functions (double,)
__internal_inline_functions (float,f)
__internal_inline_functions (long double,l)
-#undef __internal_inline_functions
+# undef __internal_inline_functions
/* Get the m68881 condition codes, to quickly check multiple conditions. */
static __inline__ unsigned long
@@ -210,12 +210,12 @@ __m81_test (long double __val)
}
/* Bit values returned by __m81_test. */
-#define __M81_COND_NAN (1 << 24)
-#define __M81_COND_INF (2 << 24)
-#define __M81_COND_ZERO (4 << 24)
-#define __M81_COND_NEG (8 << 24)
+# define __M81_COND_NAN (1 << 24)
+# define __M81_COND_INF (2 << 24)
+# define __M81_COND_ZERO (4 << 24)
+# define __M81_COND_NEG (8 << 24)
-#endif /* __LIBC_M81_MATH_INLINES */
+#endif /* __LIBC_INTENRAL_MATH_INLINES */
/* The rest of the functions are available to the user. */
@@ -374,14 +374,14 @@ __inline_functions (long double,l)
/* Note that there must be no whitespace before the argument passed for
NAME, to make token pasting work correctly with -traditional. */
-#define __inline_forward_c(rettype, name, args1, args2) \
+# define __inline_forward_c(rettype, name, args1, args2) \
extern __inline rettype __attribute__((__const__)) \
name args1 \
{ \
return __CONCAT(__,name) args2; \
}
-#define __inline_forward(rettype, name, args1, args2) \
+# define __inline_forward(rettype, name, args1, args2) \
extern __inline rettype name args1 \
{ \
return __CONCAT(__,name) args2; \
@@ -391,76 +391,76 @@ __inline_forward(double,frexp, (double __value, int *__expptr),
(__value, __expptr))
__inline_forward_c(double,floor, (double __x), (__x))
__inline_forward_c(double,ceil, (double __x), (__x))
-#ifdef __USE_MISC
+# ifdef __USE_MISC
__inline_forward_c(int,isinf, (double __value), (__value))
__inline_forward_c(int,finite, (double __value), (__value))
__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
-#endif
-#if defined __USE_MISC || defined __USE_XOPEN
-#ifndef __USE_ISOC9X /* Conflict with macro of same name. */
+# endif
+# if defined __USE_MISC || defined __USE_XOPEN
+# ifndef __USE_ISOC9X /* Conflict with macro of same name. */
__inline_forward_c(int,isnan, (double __value), (__value))
-#endif
-#endif
-#ifdef __USE_ISOC9X
+# endif
+# endif
+# ifdef __USE_ISOC9X
__inline_forward_c(double,nearbyint, (double __value), (__value))
__inline_forward_c(long int,lrint, (double __value), (__value))
__inline_forward_c(double,fma, (double __x, double __y, double __z),
(__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
__inline_forward(void,sincos, (double __x, double *__sinx, double *__cosx),
(__x, __sinx, __cosx))
-#endif
+# endif
-#if defined __USE_MISC || defined __USE_ISOC9X
+# if defined __USE_MISC || defined __USE_ISOC9X
__inline_forward(float,frexpf, (float __value, int *__expptr),
(__value, __expptr))
__inline_forward_c(float,floorf, (float __x), (__x))
__inline_forward_c(float,ceilf, (float __x), (__x))
-#ifdef __USE_MISC
+# ifdef __USE_MISC
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
-#endif
-#ifdef __USE_ISOC9X
+# endif
+# ifdef __USE_ISOC9X
__inline_forward_c(float,nearbyintf, (float __value), (__value))
__inline_forward_c(long int,lrintf, (float __value), (__value))
__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
(__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
__inline_forward(void,sincosf, (float __x, float *__sinx, float *__cosx),
(__x, __sinx, __cosx))
-#endif
+# endif
__inline_forward(long double,frexpl, (long double __value, int *__expptr),
(__value, __expptr))
__inline_forward_c(long double,floorl, (long double __x), (__x))
__inline_forward_c(long double,ceill, (long double __x), (__x))
-#ifdef __USE_MISC
+# ifdef __USE_MISC
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
-#endif
-#ifdef __USE_ISOC9X
+# endif
+# ifdef __USE_ISOC9X
__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
__inline_forward_c(long int,lrintl, (long double __value), (__value))
__inline_forward_c(long double,fmal,
(long double __x, long double __y, long double __z),
(__x, __y, __z))
-#endif
-#ifdef __USE_GNU
+# endif
+# ifdef __USE_GNU
__inline_forward(void,sincosl,
(long double __x, long double *__sinx, long double *__cosx),
(__x, __sinx, __cosx))
-#endif
+# endif
#endif /* Use misc or ISO C9X */
diff --git a/sysdeps/m68k/fpu/e_acos.c b/sysdeps/m68k/fpu/e_acos.c
index 7ea9fb014b..9c2d91f271 100644
--- a/sysdeps/m68k/fpu/e_acos.c
+++ b/sysdeps/m68k/fpu/e_acos.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/e_atan2.c b/sysdeps/m68k/fpu/e_atan2.c
index 59bc990f5b..d23d4f90d1 100644
--- a/sysdeps/m68k/fpu/e_atan2.c
+++ b/sysdeps/m68k/fpu/e_atan2.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/e_fmod.c b/sysdeps/m68k/fpu/e_fmod.c
index 1daa453618..505650a531 100644
--- a/sysdeps/m68k/fpu/e_fmod.c
+++ b/sysdeps/m68k/fpu/e_fmod.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/e_pow.c b/sysdeps/m68k/fpu/e_pow.c
index b3d151fadc..c36b64316e 100644
--- a/sysdeps/m68k/fpu/e_pow.c
+++ b/sysdeps/m68k/fpu/e_pow.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/e_scalb.c b/sysdeps/m68k/fpu/e_scalb.c
index a5923ab450..93b44ff130 100644
--- a/sysdeps/m68k/fpu/e_scalb.c
+++ b/sysdeps/m68k/fpu/e_scalb.c
@@ -17,7 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef SUFF
diff --git a/sysdeps/m68k/fpu/k_cos.c b/sysdeps/m68k/fpu/k_cos.c
index 516d45904e..5b263ec6ae 100644
--- a/sysdeps/m68k/fpu/k_cos.c
+++ b/sysdeps/m68k/fpu/k_cos.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/k_sin.c b/sysdeps/m68k/fpu/k_sin.c
index 348bc8fd9d..41de73fde7 100644
--- a/sysdeps/m68k/fpu/k_sin.c
+++ b/sysdeps/m68k/fpu/k_sin.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/k_tan.c b/sysdeps/m68k/fpu/k_tan.c
index c38327e571..7f87e09e00 100644
--- a/sysdeps/m68k/fpu/k_tan.c
+++ b/sysdeps/m68k/fpu/k_tan.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/s_atan.c b/sysdeps/m68k/fpu/s_atan.c
index f3d6960dc1..e6b676ba58 100644
--- a/sysdeps/m68k/fpu/s_atan.c
+++ b/sysdeps/m68k/fpu/s_atan.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_ccos.c b/sysdeps/m68k/fpu/s_ccos.c
index 53f8286b14..095aa9803f 100644
--- a/sysdeps/m68k/fpu/s_ccos.c
+++ b/sysdeps/m68k/fpu/s_ccos.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <complex.h>
#include <math.h>
diff --git a/sysdeps/m68k/fpu/s_ccosh.c b/sysdeps/m68k/fpu/s_ccosh.c
index 85e73b87e3..3d560b3093 100644
--- a/sysdeps/m68k/fpu/s_ccosh.c
+++ b/sysdeps/m68k/fpu/s_ccosh.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <complex.h>
#include <math.h>
diff --git a/sysdeps/m68k/fpu/s_cexp.c b/sysdeps/m68k/fpu/s_cexp.c
index 86cc894a7e..da28ebb4d3 100644
--- a/sysdeps/m68k/fpu/s_cexp.c
+++ b/sysdeps/m68k/fpu/s_cexp.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <complex.h>
#include <math.h>
diff --git a/sysdeps/m68k/fpu/s_csin.c b/sysdeps/m68k/fpu/s_csin.c
index 8eecd961a6..ae456d3b91 100644
--- a/sysdeps/m68k/fpu/s_csin.c
+++ b/sysdeps/m68k/fpu/s_csin.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <complex.h>
#include <math.h>
diff --git a/sysdeps/m68k/fpu/s_csinh.c b/sysdeps/m68k/fpu/s_csinh.c
index 643a221b57..c95f9dc523 100644
--- a/sysdeps/m68k/fpu/s_csinh.c
+++ b/sysdeps/m68k/fpu/s_csinh.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <complex.h>
#include <math.h>
diff --git a/sysdeps/m68k/fpu/s_frexp.c b/sysdeps/m68k/fpu/s_frexp.c
index 84a9a0b45d..4280fcc50b 100644
--- a/sysdeps/m68k/fpu/s_frexp.c
+++ b/sysdeps/m68k/fpu/s_frexp.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_ilogb.c b/sysdeps/m68k/fpu/s_ilogb.c
index 2d8f7d5082..aebcaa16ba 100644
--- a/sysdeps/m68k/fpu/s_ilogb.c
+++ b/sysdeps/m68k/fpu/s_ilogb.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_isinf.c b/sysdeps/m68k/fpu/s_isinf.c
index fa0d1d56db..d8cafdbb0c 100644
--- a/sysdeps/m68k/fpu/s_isinf.c
+++ b/sysdeps/m68k/fpu/s_isinf.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef FUNC
diff --git a/sysdeps/m68k/fpu/s_llrint.c b/sysdeps/m68k/fpu/s_llrint.c
index 9dfee644ed..37b6f63278 100644
--- a/sysdeps/m68k/fpu/s_llrint.c
+++ b/sysdeps/m68k/fpu/s_llrint.c
@@ -19,7 +19,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/s_llrintf.c b/sysdeps/m68k/fpu/s_llrintf.c
index 3c8528c4e8..4d06ae2651 100644
--- a/sysdeps/m68k/fpu/s_llrintf.c
+++ b/sysdeps/m68k/fpu/s_llrintf.c
@@ -19,7 +19,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/s_llrintl.c b/sysdeps/m68k/fpu/s_llrintl.c
index 55190b9eb3..14a815fd1a 100644
--- a/sysdeps/m68k/fpu/s_llrintl.c
+++ b/sysdeps/m68k/fpu/s_llrintl.c
@@ -19,7 +19,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#include "math_private.h"
diff --git a/sysdeps/m68k/fpu/s_lrint.c b/sysdeps/m68k/fpu/s_lrint.c
index 511d28880c..7747057f1a 100644
--- a/sysdeps/m68k/fpu/s_lrint.c
+++ b/sysdeps/m68k/fpu/s_lrint.c
@@ -19,7 +19,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef suffix
diff --git a/sysdeps/m68k/fpu/s_modf.c b/sysdeps/m68k/fpu/s_modf.c
index ad0334faaa..b9867df475 100644
--- a/sysdeps/m68k/fpu/s_modf.c
+++ b/sysdeps/m68k/fpu/s_modf.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_remquo.c b/sysdeps/m68k/fpu/s_remquo.c
index 0332eccfd0..7607fee782 100644
--- a/sysdeps/m68k/fpu/s_remquo.c
+++ b/sysdeps/m68k/fpu/s_remquo.c
@@ -18,7 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef SUFF
diff --git a/sysdeps/m68k/fpu/s_scalbn.c b/sysdeps/m68k/fpu/s_scalbn.c
index 1b219ec108..12b737a5e9 100644
--- a/sysdeps/m68k/fpu/s_scalbn.c
+++ b/sysdeps/m68k/fpu/s_scalbn.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#define scalbln __no_scalbln_decl
#define scalblnf __no_scalblnf_decl
#define scalblnl __no_scalblnl_decl
diff --git a/sysdeps/m68k/fpu/s_sincos.c b/sysdeps/m68k/fpu/s_sincos.c
index ada21d0fb1..dda42e2775 100644
--- a/sysdeps/m68k/fpu/s_sincos.c
+++ b/sysdeps/m68k/fpu/s_sincos.c
@@ -16,7 +16,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define __LIBC_M81_MATH_INLINES
+#define __LIBC_INTERNAL_MATH_INLINES
#include <math.h>
#ifndef FUNC
diff --git a/sysdeps/posix/sysv_signal.c b/sysdeps/posix/sysv_signal.c
index 2b6d5f9d56..c52d4af94d 100644
--- a/sysdeps/posix/sysv_signal.c
+++ b/sysdeps/posix/sysv_signal.c
@@ -56,3 +56,5 @@ __sysv_signal (sig, handler)
return oact.sa_handler;
}
+
+weak_alias (__sysv_signal, sysv_signal)
diff --git a/sysdeps/powerpc/Dist b/sysdeps/powerpc/Dist
index a3de7b3c96..9cd0a69fe3 100644
--- a/sysdeps/powerpc/Dist
+++ b/sysdeps/powerpc/Dist
@@ -1,5 +1,6 @@
fenv_const.c
fenv_libc.h
+ppc-mcount.S
quad_float.h
fe_nomask.c
t_sqrt.c
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index 2af3b78da5..f3406d7916 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -69,19 +69,20 @@ __getcwd (char *buf, size_t size)
n = __readlink ("/proc/self/cwd", path, alloc_size - 1);
if (n != -1)
{
- if (n >= alloc_size - 1)
+ if (path[0] == '/')
{
- if (size > 0)
- return NULL;
+ if (n >= alloc_size - 1)
+ {
+ if (buf == NULL)
+ free (path);
+ return NULL;
+ }
+
+ path[n] = '\0';
+ return buf ?: (char *) realloc (path, (size_t) n + 1);
}
else
- if (path[0] == '/')
- {
- path[n] = '\0';
- return buf ?: (char *) realloc (path, (size_t) n + 1);
- }
- else
- no_new_dcache = 1;
+ no_new_dcache = 1;
}
/* Set to no_new_dcache only if error indicates that proc doesn't exist. */
diff --git a/sysdeps/unix/sysv/linux/net/if.h b/sysdeps/unix/sysv/linux/net/if.h
index 861ca261de..468fed23e6 100644
--- a/sysdeps/unix/sysv/linux/net/if.h
+++ b/sysdeps/unix/sysv/linux/net/if.h
@@ -147,6 +147,7 @@ struct ifconf
#define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
#define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
+__BEGIN_DECLS
/* Convert an interface name to an index, and vice versa. */
@@ -167,4 +168,6 @@ extern struct if_nameindex *if_nameindex __P ((void));
extern void if_freenameindex __P ((struct if_nameindex *__ptr));
+__END_DECLS
+
#endif /* net/if.h */
diff --git a/sysdeps/unix/sysv/linux/pty.c b/sysdeps/unix/sysv/linux/pty.c
new file mode 100644
index 0000000000..e64261c8c4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pty.c
@@ -0,0 +1,3 @@
+/* Linux does not has the `revoke' function. */
+#define REVOKE(Line)
+#include <sysdeps/generic/pty.c>
diff --git a/time/mktime.c b/time/mktime.c
index 406f55e170..fcb3cc8f95 100644
--- a/time/mktime.c
+++ b/time/mktime.c
@@ -25,6 +25,11 @@
# include <config.h>
#endif
+/* Some hosts need this in order to declare localtime_r properly. */
+#ifndef _REENTRANT
+# define _REENTRANT 1
+#endif
+
#ifdef _LIBC
# define HAVE_LIMITS_H 1
# define HAVE_LOCALTIME_R 1
diff --git a/time/strftime.c b/time/strftime.c
index 0ebc913090..e09d0fd26f 100644
--- a/time/strftime.c
+++ b/time/strftime.c
@@ -20,6 +20,11 @@
# include <config.h>
#endif
+/* Some hosts need this in order to declare localtime_r properly. */
+#ifndef _REENTRANT
+# define _REENTRANT 1
+#endif
+
#ifdef _LIBC
# define HAVE_LIMITS_H 1
# define HAVE_MBLEN 1