[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commits] r22920 - in /fsf/trunk/libc: ./ benchtests/ nss/nss_files/ sysdeps/posix/ sysdeps/powerpc/power5/ sysdeps/powerpc/power5/fpu...



Author: eglibc
Date: Wed Apr 24 00:02:02 2013
New Revision: 22920

Log:
Import glibc-mainline for 2013-04-24

Added:
    fsf/trunk/libc/benchtests/bench-modf.c
    fsf/trunk/libc/sysdeps/posix/timespec_get.c
    fsf/trunk/libc/sysdeps/powerpc/power5/
    fsf/trunk/libc/sysdeps/powerpc/power5/fpu/
    fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modf.c
    fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modff.c
    fsf/trunk/libc/time/tst-strptime-whitespace.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/benchtests/Makefile
    fsf/trunk/libc/nss/nss_files/files-init.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/power5/Implies
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/power5/Implies
    fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h
    fsf/trunk/libc/time/Makefile
    fsf/trunk/libc/time/strptime_l.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Apr 24 00:02:02 2013
@@ -1,3 +1,39 @@
+2013-04-23  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* sysdeps/posix/timespec_get.c: New file.
+
+2013-04-23  Adhemerval Zanella  <azanella@xxxxxxxxxxxxxxxxxx>
+
+	* sysdeps/powerpc/power5/fpu/s_modf.c: New file: modf optimization for
+	POWER.
+	* sysdeps/powerpc/power5/fpu/s_modff.c: New file: modff optimization
+	for POWER.
+	* sysdeps/powerpc/powerpc64/power5/Implies: Add powerpc/power5 and
+	powerpc/power5/fpu folders.
+	* sysdeps/powerpc/powerpc32/power5/Implies: Likewise.
+	* benchtests/Makefile: Add modf testcase.
+	* benchtests/bench-modf.c: New file: Benchmark test for mo
+
+2013-04-23  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	[BZ #14888]
+	* time/Makefile (tests): Add tst-strptime-whitespace.
+	* time/strptime_l.c (get_number): Use ISSPACE.
+	(__strptime_internal): Likewise.
+	* time/tst-strptime-whitespace.c: New test case.
+
+2013-04-23  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* nss/nss_files/files-init.c (TF): Don't initialize flexible array
+	member.
+	(_nss_files_init): Set it here.
+
+2013-04-23  Heiko Carstens  <heiko.carstens@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/s390/bits/statfs.h: Change types of
+	f_type, f_bsize, f_namelen, f_frsize, f_flags,and f_spare to
+	unsigned.
+
 2013-04-22  Jan-Benedict Glaw  <jbglaw@xxxxxxxxxxx>
 
 	* nss/getent.c (shadow_keys): Call endspent, not endpwent.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed Apr 24 00:02:02 2013
@@ -11,10 +11,10 @@
 
   10060, 10062, 10357, 11120, 11561, 12723, 13550, 13889, 13951, 13988,
   14142, 14176, 14200, 14293, 14317, 14327, 14478, 14496, 14686, 14812,
-  14920, 14964, 14981, 14982, 14985, 14994, 14996, 15003, 15006, 15020,
-  15023, 15036, 15054, 15055, 15062, 15078, 15160, 15214, 15232, 15234,
-  15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330, 15335,
-  15336, 15337, 15342, 15346, 15361.
+  14888, 14920, 14964, 14981, 14982, 14985, 14994, 14996, 15003, 15006,
+  15020, 15023, 15036, 15054, 15055, 15062, 15078, 15160, 15214, 15232,
+  15234, 15283, 15285, 15287, 15304, 15305, 15307, 15309, 15327, 15330,
+  15335, 15336, 15337, 15342, 15346, 15361.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).

Modified: fsf/trunk/libc/benchtests/Makefile
==============================================================================
--- fsf/trunk/libc/benchtests/Makefile (original)
+++ fsf/trunk/libc/benchtests/Makefile Wed Apr 24 00:02:02 2013
@@ -45,7 +45,7 @@
 #   See pow-inputs for an example.
 
 subdir := benchtests
-bench := exp pow rint sin cos tan atan \
+bench := exp pow rint sin cos tan atan modf \
 	 slowexp slowpow slowsin slowcos slowtan slowatan
 
 # exp function fast path

Added: fsf/trunk/libc/benchtests/bench-modf.c
==============================================================================
--- fsf/trunk/libc/benchtests/bench-modf.c (added)
+++ fsf/trunk/libc/benchtests/bench-modf.c Wed Apr 24 00:02:02 2013
@@ -1,0 +1,39 @@
+/* Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+extern double modf (double, double *);
+
+#define CALL_BENCH_FUNC(j, i) modf ( in[j].arg0, &i);
+
+struct args
+{
+  double arg0;
+} in[] =
+{
+  {  42.42 },
+  { -42.42 }
+};
+
+#define NUM_SAMPLES (sizeof (in) / sizeof (struct args))
+
+static volatile double ret = 0.0;
+#define BENCH_FUNC(j) ({double iptr; ret =  CALL_BENCH_FUNC (j, iptr);})
+
+#define ITER 250000000
+#define FUNCNAME "modf"
+
+#include "bench-skeleton.c"

Modified: fsf/trunk/libc/nss/nss_files/files-init.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-init.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-init.c Wed Apr 24 00:02:02 2013
@@ -18,6 +18,7 @@
 
 #ifdef USE_NSCD
 
+#include <string.h>
 #include <nscd/nscd.h>
 
 
@@ -30,7 +31,7 @@
   {								\
     .file =							\
     {								\
-      .fname = filename, ## __VA_ARGS__				\
+      __VA_ARGS__						\
     }								\
   }
 
@@ -45,16 +46,22 @@
 void
 _nss_files_init (void (*cb) (size_t, struct traced_file *))
 {
+  strcpy (pwd_traced_file.file.fname, "/etc/passwd");
   cb (pwddb, &pwd_traced_file.file);
 
+  strcpy (grp_traced_file.file.fname, "/etc/group");
   cb (grpdb, &grp_traced_file.file);
 
+  strcpy (hst_traced_file.file.fname, "/etc/hosts");
   cb (hstdb, &hst_traced_file.file);
 
+  strcpy (resolv_traced_file.file.fname, "/etc/resolv.conf");
   cb (hstdb, &resolv_traced_file.file);
 
+  strcpy (serv_traced_file.file.fname, "/etc/services");
   cb (servdb, &serv_traced_file.file);
 
+  strcpy (netgr_traced_file.file.fname, "/etc/netgroup");
   cb (netgrdb, &netgr_traced_file.file);
 }
 

Added: fsf/trunk/libc/sysdeps/posix/timespec_get.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/timespec_get.c (added)
+++ fsf/trunk/libc/sysdeps/posix/timespec_get.c Wed Apr 24 00:02:02 2013
@@ -1,0 +1,38 @@
+/* timespec_get -- C11 interface to sample a clock.  Generic POSIX.1 version.
+   Copyright (C) 2013 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.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <time.h>
+
+
+/* Set TS to calendar time based in time base BASE.  */
+int
+timespec_get (struct timespec *ts, int base)
+{
+  switch (base)
+    {
+    case TIME_UTC:
+      if (__clock_gettime (CLOCK_REALTIME, ts) < 0)
+        return 0;
+      break;
+
+    default:
+      return 0;
+    }
+
+  return base;
+}

Added: fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modf.c (added)
+++ fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modf.c Wed Apr 24 00:02:02 2013
@@ -1,0 +1,58 @@
+/* Copyright (C) 2013 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, see <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_private.h>
+#include <math_ldbl_opt.h>
+
+double
+__modf (double x, double *iptr)
+{
+  if (__builtin_isinf (x))
+    {
+      *iptr = x;
+      return __copysign (0.0, x);
+    }
+  else if (__builtin_isnan (x))
+    {
+      *iptr = NAN;
+      return NAN;
+    }
+
+  if (x >= 0.0)
+    {
+      *iptr = __floor (x);
+      return (x - *iptr);
+    }
+  else
+    {
+      *iptr = __ceil (x);
+      return (x - *iptr);
+    }
+}
+weak_alias (__modf, modf)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__modf, __modfl)
+weak_alias (__modf, modfl)
+#endif
+#ifdef IS_IN_libm
+# if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
+compat_symbol (libm, __modf, modfl, GLIBC_2_0);
+# endif
+#elif LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __modf, modfl, GLIBC_2_0);
+#endif

Added: fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modff.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modff.c (added)
+++ fsf/trunk/libc/sysdeps/powerpc/power5/fpu/s_modff.c Wed Apr 24 00:02:02 2013
@@ -1,0 +1,46 @@
+/* Copyright (C) 2013 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, see <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include <math_private.h>
+
+float
+__modff (float x, float *iptr)
+{
+  if (__builtin_isinff (x))
+    {
+      *iptr = x;
+      return __copysignf (0.0, x);
+    }
+  else if (__builtin_isnanf (x))
+    {
+      *iptr = NAN;
+      return NAN;
+    }
+
+  if (x >= 0.0)
+    {
+      *iptr = __floorf (x);
+      return (x - *iptr);
+    }
+  else
+    {
+      *iptr = __ceilf (x);
+      return (x - *iptr);
+    }
+}
+weak_alias (__modff, modff)

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power5/Implies
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power5/Implies (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power5/Implies Wed Apr 24 00:02:02 2013
@@ -1,2 +1,4 @@
+powerpc/power5/fpu
+powerpc/power5
 powerpc/powerpc32/power4/fpu
 powerpc/powerpc32/power4

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/power5/Implies
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/power5/Implies (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/power5/Implies Wed Apr 24 00:02:02 2013
@@ -1,2 +1,4 @@
+powerpc/power5/fpu
+powerpc/power5
 powerpc/powerpc64/power4/fpu
 powerpc/powerpc64/power4

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/bits/statfs.h Wed Apr 24 00:02:02 2013
@@ -23,8 +23,8 @@
 
 struct statfs
   {
-    int f_type;
-    int f_bsize;
+    unsigned int f_type;
+    unsigned int f_bsize;
 #ifndef __USE_FILE_OFFSET64
     __fsblkcnt_t f_blocks;
     __fsblkcnt_t f_bfree;
@@ -39,27 +39,27 @@
     __fsfilcnt64_t f_ffree;
 #endif
     __fsid_t f_fsid;
-    int f_namelen;
-    int f_frsize;
-    int f_flags;
-    int f_spare[4];
+    unsigned int f_namelen;
+    unsigned int f_frsize;
+    unsigned int f_flags;
+    unsigned int f_spare[4];
   };
 
 #ifdef __USE_LARGEFILE64
 struct statfs64
   {
-    int f_type;
-    int f_bsize;
+    unsigned int f_type;
+    unsigned int f_bsize;
     __fsblkcnt64_t f_blocks;
     __fsblkcnt64_t f_bfree;
     __fsblkcnt64_t f_bavail;
     __fsfilcnt64_t f_files;
     __fsfilcnt64_t f_ffree;
     __fsid_t f_fsid;
-    int f_namelen;
-    int f_frsize;
-    int f_flags;
-    int f_spare[4];
+    unsigned int f_namelen;
+    unsigned int f_frsize;
+    unsigned int f_flags;
+    unsigned int f_spare[4];
   };
 #endif
 

Modified: fsf/trunk/libc/time/Makefile
==============================================================================
--- fsf/trunk/libc/time/Makefile (original)
+++ fsf/trunk/libc/time/Makefile Wed Apr 24 00:02:02 2013
@@ -35,7 +35,7 @@
 tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
 	   tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
 	   tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
-	   tst-strptime3 bug-getdate1
+	   tst-strptime3 bug-getdate1 tst-strptime-whitespace
 
 include ../Rules
 

Modified: fsf/trunk/libc/time/strptime_l.c
==============================================================================
--- fsf/trunk/libc/time/strptime_l.c (original)
+++ fsf/trunk/libc/time/strptime_l.c Wed Apr 24 00:02:02 2013
@@ -72,7 +72,7 @@
   do {									      \
     int __n = n;							      \
     val = 0;								      \
-    while (*rp == ' ')							      \
+    while (ISSPACE (*rp))						      \
       ++rp;								      \
     if (*rp < '0' || *rp > '9')						      \
       return NULL;							      \
@@ -752,7 +752,7 @@
 	     also specified.  */
 	  {
 	    val = 0;
-	    while (*rp == ' ')
+	    while (ISSPACE (*rp))
 	      ++rp;
 	    if (*rp != '+' && *rp != '-')
 	      return NULL;

Added: fsf/trunk/libc/time/tst-strptime-whitespace.c
==============================================================================
--- fsf/trunk/libc/time/tst-strptime-whitespace.c (added)
+++ fsf/trunk/libc/time/tst-strptime-whitespace.c Wed Apr 24 00:02:02 2013
@@ -1,0 +1,43 @@
+/* Verify that strptime accepts arbitrary whitespace between tokens.
+
+   Copyright (C) 2013 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define _XOPEN_SOURCE
+#include <time.h>
+#include <stdio.h>
+#include <string.h>
+
+int
+do_test (void)
+{
+  struct tm t;
+  const char *in = "Tuesday \t 22 \t July\t1942";
+
+  char *r = strptime (in, "%A%d %b%Y", &t);
+
+  if (r == NULL || r != in + strlen (in))
+    {
+      printf ("strptime failed\n");
+      return 1;
+    }
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits