From 736e2ab430e006ba09a2fe34d7887d3812ac808f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 21 Jul 2005 08:25:57 +0000 Subject: Updated to fedora-glibc-20050721T0814 --- sysdeps/generic/clock_gettime.c | 3 +- sysdeps/generic/feholdexcpt.c | 3 +- sysdeps/generic/fesetround.c | 3 +- sysdeps/generic/s_significand.c | 2 +- sysdeps/generic/s_significandf.c | 4 +- sysdeps/generic/stpncpy_chk.c | 85 ++++++++++++++++++++++++++++++++++++++++ sysdeps/generic/wordexp.c | 7 +--- 7 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 sysdeps/generic/stpncpy_chk.c (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/clock_gettime.c b/sysdeps/generic/clock_gettime.c index 85bb79c548..ff306120ba 100644 --- a/sysdeps/generic/clock_gettime.c +++ b/sysdeps/generic/clock_gettime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2005 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 @@ -26,5 +26,6 @@ clock_gettime (clockid_t clock_id, struct timespec *tp) __set_errno (ENOSYS); return -1; } +librt_hidden_def (clock_gettime) stub_warning (clock_gettime) #include diff --git a/sysdeps/generic/feholdexcpt.c b/sysdeps/generic/feholdexcpt.c index 927a6dc95c..8680d1e492 100644 --- a/sysdeps/generic/feholdexcpt.c +++ b/sysdeps/generic/feholdexcpt.c @@ -1,5 +1,5 @@ /* Store current floating-point environment and clear exceptions. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -25,5 +25,6 @@ feholdexcept (fenv_t *envp) { return 1; /* Signal failure. */ } +libm_hidden_def (feholdexcept) stub_warning (feholdexcept) #include diff --git a/sysdeps/generic/fesetround.c b/sysdeps/generic/fesetround.c index e5a27d2aa0..5b14826390 100644 --- a/sysdeps/generic/fesetround.c +++ b/sysdeps/generic/fesetround.c @@ -1,5 +1,5 @@ /* Set current rounding direction. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -25,5 +25,6 @@ fesetround (int round) { return 1; /* Signal we are unable to set the direction. */ } +libm_hidden_def (fesetround) stub_warning (fesetround) #include diff --git a/sysdeps/generic/s_significand.c b/sysdeps/generic/s_significand.c index 4ab078c473..f95b6481c2 100644 --- a/sysdeps/generic/s_significand.c +++ b/sysdeps/generic/s_significand.c @@ -30,7 +30,7 @@ static char rcsid[] = "$NetBSD: s_significand.c,v 1.6 1995/05/10 20:48:11 jtc Ex double x; #endif { - return __ieee754_scalb(x,(double) -ilogb(x)); + return __ieee754_scalb(x,(double) -__ilogb(x)); } weak_alias (__significand, significand) #ifdef NO_LONG_DOUBLE diff --git a/sysdeps/generic/s_significandf.c b/sysdeps/generic/s_significandf.c index 2893a4e1b7..cf5eb59efc 100644 --- a/sysdeps/generic/s_significandf.c +++ b/sysdeps/generic/s_significandf.c @@ -8,7 +8,7 @@ * * Developed at SunPro, a Sun Microsystems, Inc. business. * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice + * software is freely granted, provided that this notice * is preserved. * ==================================================== */ @@ -27,6 +27,6 @@ static char rcsid[] = "$NetBSD: s_significandf.c,v 1.3 1995/05/10 20:48:13 jtc E float x; #endif { - return __ieee754_scalbf(x,(float) -ilogbf(x)); + return __ieee754_scalbf(x,(float) -__ilogbf(x)); } weak_alias (__significandf, significandf) diff --git a/sysdeps/generic/stpncpy_chk.c b/sysdeps/generic/stpncpy_chk.c new file mode 100644 index 0000000000..d136339dea --- /dev/null +++ b/sysdeps/generic/stpncpy_chk.c @@ -0,0 +1,85 @@ +/* Copyright (C) 1993,1995,1996,1997,2002,2005 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 Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This is almost copied from strncpy.c, written by Torbjorn Granlund. */ + +#include + + +/* Copy no more than N characters of SRC to DEST, returning the address of + the terminating '\0' in DEST, if any, or else DEST + N. */ +char * +__stpncpy_chk (char *dest, const char *src, size_t n, size_t destlen) +{ + char c; + char *s = dest; + + if (__builtin_expect (destlen < n, 0)) + __chk_fail (); + + if (n >= 4) + { + size_t n4 = n >> 2; + + for (;;) + { + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + c = *src++; + *dest++ = c; + if (c == '\0') + break; + if (--n4 == 0) + goto last_chars; + } + n -= dest - s; + goto zero_fill; + } + + last_chars: + n &= 3; + if (n == 0) + return dest; + + for (;;) + { + c = *src++; + --n; + *dest++ = c; + if (c == '\0') + break; + if (n == 0) + return dest; + } + + zero_fill: + while (n-- > 0) + dest[n] = '\0'; + + return dest - 1; +} diff --git a/sysdeps/generic/wordexp.c b/sysdeps/generic/wordexp.c index 06d38f6b24..2eb58089c4 100644 --- a/sysdeps/generic/wordexp.c +++ b/sysdeps/generic/wordexp.c @@ -1798,12 +1798,7 @@ envsubst: if (str[0] == '\0') str = _("parameter null or not set"); -#ifdef USE_IN_LIBIO - if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s: %s\n", env, str); - else -#endif - fprintf (stderr, "%s: %s\n", env, str); + __fxprintf (NULL, "%s: %s\n", env, str); } if (free_value) -- cgit 1.4.1