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

[Commits] r23301 - in /fsf/trunk/libc: ./ manual/ math/ nptl/ nptl/sysdeps/pthread/ ports/ ports/sysdeps/unix/sysv/linux/aarch64/nptl/...



Author: eglibc
Date: Sun Jun 16 00:02:12 2013
New Revision: 23301

Log:
Import glibc-mainline for 2013-06-16

Added:
    fsf/trunk/libc/nptl/pthread_getattr_default_np.c
    fsf/trunk/libc/nptl/pthread_setattr_default_np.c
    fsf/trunk/libc/nptl/tst-default-attr.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/Versions.def
    fsf/trunk/libc/manual/threads.texi
    fsf/trunk/libc/math/libm-test.inc
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/Makefile
    fsf/trunk/libc/nptl/Versions
    fsf/trunk/libc/nptl/allocatestack.c
    fsf/trunk/libc/nptl/nptl-init.c
    fsf/trunk/libc/nptl/pthreadP.h
    fsf/trunk/libc/nptl/pthread_attr_getstacksize.c
    fsf/trunk/libc/nptl/pthread_create.c
    fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h
    fsf/trunk/libc/nptl/vars.c
    fsf/trunk/libc/ports/ChangeLog.aarch64
    fsf/trunk/libc/ports/ChangeLog.alpha
    fsf/trunk/libc/ports/ChangeLog.arm
    fsf/trunk/libc/ports/ChangeLog.ia64
    fsf/trunk/libc/ports/ChangeLog.m68k
    fsf/trunk/libc/ports/ChangeLog.microblaze
    fsf/trunk/libc/ports/ChangeLog.mips
    fsf/trunk/libc/ports/ChangeLog.powerpc
    fsf/trunk/libc/ports/ChangeLog.tile
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/microblaze/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
    fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_sqrt.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jun 16 00:02:12 2013
@@ -1,3 +1,39 @@
+2013-06-15  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #15631]
+	* sysdeps/ieee754/dbl-64/e_sqrt.c (__ieee754_sqrt): Save and
+	restore exception state around main square root computation, then
+	check for inexactness explicitly.
+
+	* math/libm-test.inc (fma_test_data): Add another test.
+
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* manual/threads.texi (Non-POSIX Extensions): New document
+	node.  Document pthread_getattr_default_np and
+	pthread_setattr_default_np.
+
+	* Versions.def (libpthread): Add GLIBC_2.18.
+	* sysdeps/unix/sysv/linux/i386/nptl/libpthread.abilist: Update.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/sh/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist:
+	Likewise.
+
 2013-06-14  Liubov Dmitrieva  <liubov.dmitrieva@xxxxxxxxx>
 
 	* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features):

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sun Jun 16 00:02:12 2013
@@ -20,7 +20,7 @@
   15366, 15380, 15381, 15394, 15395, 15405, 15406, 15409, 15416, 15418,
   15419, 15423, 15424, 15426, 15429, 15431, 15432, 15441, 15442, 15448,
   15465, 15480, 15485, 15488, 15490, 15492, 15493, 15497, 15506, 15529,
-  15536, 15553, 15577, 15583, 15618, 15627.
+  15536, 15553, 15577, 15583, 15618, 15627, 15631.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
@@ -45,6 +45,10 @@
 
 * On Linux, the clock function now uses the clock_gettime system call
   for improved precision, rather than old times system call.
+
+* Added new API functions pthread_getattr_default_np and
+  pthread_setattr_default_np to get and set the default pthread
+  attributes of a process.
 
 Version 2.17
 

Modified: fsf/trunk/libc/Versions.def
==============================================================================
--- fsf/trunk/libc/Versions.def (original)
+++ fsf/trunk/libc/Versions.def Sun Jun 16 00:02:12 2013
@@ -102,6 +102,7 @@
   GLIBC_2.6
   GLIBC_2.11
   GLIBC_2.12
+  GLIBC_2.18
   GLIBC_PRIVATE
 }
 libresolv {

Modified: fsf/trunk/libc/manual/threads.texi
==============================================================================
--- fsf/trunk/libc/manual/threads.texi (original)
+++ fsf/trunk/libc/manual/threads.texi Sun Jun 16 00:02:12 2013
@@ -9,6 +9,8 @@
 @menu
 * Thread-specific Data::          Support for creating and
 				  managing thread-specific data
+* Non-POSIX Extensions::          Additional functions to extend
+				  POSIX Thread functionality
 @end menu
 
 @node Thread-specific Data
@@ -42,3 +44,41 @@
 Associate the thread-specific @var{value} with @var{key} in the calling thread.
 
 @end table
+
+@node Non-POSIX Extensions
+@section Non-POSIX Extensions
+
+In addition to implementing the POSIX API for threads, @theglibc{} provides
+additional functions and interfaces to provide functionality not specified in
+the standard.
+
+@menu
+* Default Thread Attributes::             Setting default attributes for
+					  threads in a process.
+@end menu
+
+@node Default Thread Attributes
+@subsection Setting Process-wide defaults for thread attributes
+
+@Theglibc{} provides non-standard API functions to set and get the default
+attributes used in the creation of threads in a process.
+
+@deftypefun int pthread_getattr_default_np (pthread_attr_t *@var{attr})
+Get the default attribute values and set @var{attr} to match.  This
+function returns @math{0} on success and a non-zero error code on
+failure.
+@end deftypefun
+
+@deftypefun int pthread_getattr_default_np (pthread_attr_t *@var{attr})
+Set the default attribute values to match the values in @var{attr}.  The
+function returns @math{0} on success and a non-zero error code on failure.
+The following error codes are defined for this function:
+
+@table @code
+@item EINVAL
+At least one of the values in @var{attr} does not qualify as valid for the
+attributes or the stack address is set in the attribute.
+@item ENOMEM
+The system does not have sufficient memory.
+@end table
+@end deftypefun

Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sun Jun 16 00:02:12 2013
@@ -8482,6 +8482,7 @@
     TEST_fff_f (fma, 0x1.00000000000007ffffffffffffffp-9045L, -0x1.ffffffffffff80000001ffffffffp+4773L, -0x1.f8p-4316L, -0x1.00000000000f88000000fffffdffp-4271L),
     TEST_fff_f (fma, 0x1.4e922764c90701d4a2f21d01893dp-8683L, -0x1.955a12e2d7c9447c27fa022fc865p+212L, -0x1.e9634462eaef96528b90b6944578p-8521L, -0x1.08e1783184a371943d3598e10865p-8470L),
     TEST_fff_f (fma, 0x1.801181509c03bdbef10d6165588cp-15131L, 0x1.ad86f8e57d3d40bfa8007780af63p-368L, -0x1.6e9df0dab1c9f1d7a6043c390741p-15507L, 0x1.417c9b2b15e2ad57dc9e0e920844p-15498L),
+    TEST_fff_f (fma, 0x1.ffffffffffffffp0L, 0x1.000000000000008p0L, -0x1p-1000L, 0x1.ffffffffffffffffffffffffffffp0L),
     TEST_fff_f (fma, 0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, 0x1p-16384L, 0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION),
     TEST_fff_f (fma, -0x1.4p-16382L, 0x1.0000000000000000000000000002p-1L, -0x1p-16384L, -0x1.c000000000000000000000000002p-16383L, UNDERFLOW_EXCEPTION),
     TEST_fff_f (fma, 0x1.fffffffffffffffffffffffffffcp-16382L, 0x1.0000000000000000000000000001p-1L, 0x1p-16494L, 0x1p-16382L, UNDERFLOW_EXCEPTION_BEFORE_ROUNDING),

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Sun Jun 16 00:02:12 2013
@@ -1,3 +1,30 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* Versions (libpthread): Add GLIBC_2.18.
+	(GLIBC_2.18): Add pthread_setattr_default_np and
+	pthread_getattr_default_np.
+	* allocatestack.c (allocate_stack): Synchronize read from
+	__default_pthread_attr.
+	(__reclaim_stacks): Initialize __default_pthread_attr_lock.
+	* nptl-init.c (__pthread_initialize_minimal_internal):
+	Synchronize write to __default_pthread_attr.
+	* pthreadP.h (__default_pthread_attr_lock): Declare.
+	* pthread_attr_getstacksize (__pthread_attr_getstacksize):
+	Synchronize read from __default_pthread_attr.
+	* pthread_create.c (__pthread_create_2_1): Make a local copy of
+	__default_pthread_attr.  Check value of flags in IATTR even if
+	input ATTR is NULL.
+	* pthread_getattr_default_np.c: New file.
+	* pthread_setattr_default_np.c: New file.
+	* sysdeps/pthread/pthread.h [__USE_GNU]
+	(pthread_getattr_default_np, pthread_setattr_default_np):
+	Declare.
+	* tst-default-attr.c: New test case.
+	* Makefile (libpthread-routines): Add
+	pthread_setattr_default_np and pthread_getattr_default_np.
+	(tests): Add tst-default-attr.
+	* vars.c (__default_pthread_attr_lock): Declare and initialize.
+
 2013-06-13  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
 	    Carlos O'Donell  <carlos@xxxxxxxxxx>
 

Modified: fsf/trunk/libc/nptl/Makefile
==============================================================================
--- fsf/trunk/libc/nptl/Makefile (original)
+++ fsf/trunk/libc/nptl/Makefile Sun Jun 16 00:02:12 2013
@@ -125,7 +125,8 @@
 		      pthread_mutexattr_setprioceiling tpp \
 		      pthread_mutex_getprioceiling \
 		      pthread_mutex_setprioceiling \
-		      pthread_setname pthread_getname
+		      pthread_setname pthread_getname \
+		      pthread_setattr_default_np pthread_getattr_default_np
 #		      pthread_setuid pthread_seteuid pthread_setreuid \
 #		      pthread_setresuid \
 #		      pthread_setgid pthread_setegid pthread_setregid \
@@ -201,7 +202,7 @@
 
 
 tests = tst-typesizes \
-	tst-attr1 tst-attr2 tst-attr3 \
+	tst-attr1 tst-attr2 tst-attr3 tst-default-attr \
 	tst-mutex1 tst-mutex2 tst-mutex3 tst-mutex4 tst-mutex5 tst-mutex6 \
 	tst-mutex7 tst-mutex8 tst-mutex9 tst-mutex5a tst-mutex7a \
 	tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \

Modified: fsf/trunk/libc/nptl/Versions
==============================================================================
--- fsf/trunk/libc/nptl/Versions (original)
+++ fsf/trunk/libc/nptl/Versions Sun Jun 16 00:02:12 2013
@@ -252,6 +252,11 @@
     pthread_setname_np; pthread_getname_np;
   };
 
+  GLIBC_2.18 {
+    pthread_getattr_default_np;
+    pthread_setattr_default_np;
+  }
+
   GLIBC_PRIVATE {
     __pthread_initialize_minimal;
     __pthread_clock_gettime; __pthread_clock_settime;

Modified: fsf/trunk/libc/nptl/allocatestack.c
==============================================================================
--- fsf/trunk/libc/nptl/allocatestack.c (original)
+++ fsf/trunk/libc/nptl/allocatestack.c Sun Jun 16 00:02:12 2013
@@ -358,7 +358,14 @@
 
   /* Get the stack size from the attribute if it is set.  Otherwise we
      use the default we determined at start time.  */
-  size = attr->stacksize ?: __default_pthread_attr.stacksize;
+  if (attr->stacksize != 0)
+    size = attr->stacksize;
+  else
+    {
+      lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+      size = __default_pthread_attr.stacksize;
+      lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+    }
 
   /* Get memory for the stack.  */
   if (__builtin_expect (attr->flags & ATTR_FLAG_STACKADDR, 0))
@@ -919,8 +926,9 @@
 
   in_flight_stack = 0;
 
-  /* Initialize the lock.  */
+  /* Initialize locks.  */
   stack_cache_lock = LLL_LOCK_INITIALIZER;
+  __default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
 }
 
 

Modified: fsf/trunk/libc/nptl/nptl-init.c
==============================================================================
--- fsf/trunk/libc/nptl/nptl-init.c (original)
+++ fsf/trunk/libc/nptl/nptl-init.c Sun Jun 16 00:02:12 2013
@@ -423,8 +423,10 @@
 
   /* Round the resource limit up to page size.  */
   limit.rlim_cur = (limit.rlim_cur + pagesz - 1) & -pagesz;
+  lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
   __default_pthread_attr.stacksize = limit.rlim_cur;
   __default_pthread_attr.guardsize = GLRO (dl_pagesize);
+  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
 
 #ifdef SHARED
   /* Transfer the old value from the dynamic linker's internal location.  */

Modified: fsf/trunk/libc/nptl/pthreadP.h
==============================================================================
--- fsf/trunk/libc/nptl/pthreadP.h (original)
+++ fsf/trunk/libc/nptl/pthreadP.h Sun Jun 16 00:02:12 2013
@@ -149,6 +149,7 @@
 
 /* Default pthread attributes.  */
 extern struct pthread_attr __default_pthread_attr attribute_hidden;
+extern int __default_pthread_attr_lock attribute_hidden;
 
 /* Size and alignment of static TLS block.  */
 extern size_t __static_tls_size attribute_hidden;

Modified: fsf/trunk/libc/nptl/pthread_attr_getstacksize.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_attr_getstacksize.c (original)
+++ fsf/trunk/libc/nptl/pthread_attr_getstacksize.c Sun Jun 16 00:02:12 2013
@@ -30,9 +30,17 @@
   assert (sizeof (*attr) >= sizeof (struct pthread_attr));
   iattr = (struct pthread_attr *) attr;
 
+  size_t size = iattr->stacksize;
+
   /* If the user has not set a stack size we return what the system
      will use as the default.  */
-  *stacksize = iattr->stacksize ?: __default_pthread_attr.stacksize;
+  if (size == 0)
+    {
+      lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+      size = __default_pthread_attr.stacksize;
+      lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+    }
+  *stacksize = size;
 
   return 0;
 }

Modified: fsf/trunk/libc/nptl/pthread_create.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_create.c (original)
+++ fsf/trunk/libc/nptl/pthread_create.c Sun Jun 16 00:02:12 2013
@@ -449,18 +449,47 @@
   STACK_VARIABLES;
 
   const struct pthread_attr *iattr = (struct pthread_attr *) attr;
+  struct pthread_attr default_attr;
+  bool free_cpuset = false;
   if (iattr == NULL)
-    /* Is this the best idea?  On NUMA machines this could mean
-       accessing far-away memory.  */
-    iattr = &__default_pthread_attr;
+    {
+      lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+      default_attr = __default_pthread_attr;
+      size_t cpusetsize = default_attr.cpusetsize;
+      if (cpusetsize > 0)
+	{
+	  cpu_set_t *cpuset;
+	  if (__glibc_likely (__libc_use_alloca (cpusetsize)))
+	    cpuset = __alloca (cpusetsize);
+	  else
+	    {
+	      cpuset = malloc (cpusetsize);
+	      if (cpuset == NULL)
+		{
+		  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+		  return ENOMEM;
+		}
+	      free_cpuset = true;
+	    }
+	  memcpy (cpuset, default_attr.cpuset, cpusetsize);
+	  default_attr.cpuset = cpuset;
+	}
+      lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+      iattr = &default_attr;
+    }
 
   struct pthread *pd = NULL;
   int err = ALLOCATE_STACK (iattr, &pd);
+  int retval = 0;
+
   if (__builtin_expect (err != 0, 0))
     /* Something went wrong.  Maybe a parameter of the attributes is
        invalid or we could not allocate memory.  Note we have to
        translate error codes.  */
-    return err == ENOMEM ? EAGAIN : err;
+    {
+      retval = err == ENOMEM ? EAGAIN : err;
+      goto out;
+    }
 
 
   /* Initialize the TCB.  All initializations with zero should be
@@ -511,8 +540,7 @@
 #endif
 
   /* Determine scheduling parameters for the thread.  */
-  if (attr != NULL
-      && __builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0)
+  if (__builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0)
       && (iattr->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)) != 0)
     {
       INTERNAL_SYSCALL_DECL (scerr);
@@ -551,7 +579,8 @@
 
 	  __deallocate_stack (pd);
 
-	  return EINVAL;
+	  retval = EINVAL;
+	  goto out;
 	}
     }
 
@@ -561,7 +590,13 @@
   LIBC_PROBE (pthread_create, 4, newthread, attr, start_routine, arg);
 
   /* Start the thread.  */
-  return create_thread (pd, iattr, STACK_VARIABLES_ARGS);
+  retval = create_thread (pd, iattr, STACK_VARIABLES_ARGS);
+
+ out:
+  if (__glibc_unlikely (free_cpuset))
+    free (default_attr.cpuset);
+
+  return retval;
 }
 versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1);
 

Added: fsf/trunk/libc/nptl/pthread_getattr_default_np.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_getattr_default_np.c (added)
+++ fsf/trunk/libc/nptl/pthread_getattr_default_np.c Sun Jun 16 00:02:12 2013
@@ -1,0 +1,37 @@
+/* Get the default attributes used by pthread_create in the process.
+   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/>.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <pthreadP.h>
+#include <assert.h>
+
+int
+pthread_getattr_default_np (pthread_attr_t *out)
+{
+  struct pthread_attr *real_out;
+
+  assert (sizeof (*out) >= sizeof (struct pthread_attr));
+  real_out = (struct pthread_attr *) out;
+
+  lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+  *real_out = __default_pthread_attr;
+  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+
+  return 0;
+}

Added: fsf/trunk/libc/nptl/pthread_setattr_default_np.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_setattr_default_np.c (added)
+++ fsf/trunk/libc/nptl/pthread_setattr_default_np.c Sun Jun 16 00:02:12 2013
@@ -1,0 +1,110 @@
+/* Set the default attributes to be used by pthread_create in the process.
+   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/>.  */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <pthreadP.h>
+#include <assert.h>
+
+int
+pthread_setattr_default_np (const pthread_attr_t *in)
+{
+  const struct pthread_attr *real_in;
+  struct pthread_attr attrs;
+  int ret;
+
+  assert (sizeof (*in) >= sizeof (struct pthread_attr));
+  real_in = (struct pthread_attr *) in;
+
+  /* Catch invalid values.  */
+  int policy = real_in->schedpolicy;
+  ret = check_sched_policy_attr (policy);
+  if (ret)
+    return ret;
+
+  const struct sched_param *param = &real_in->schedparam;
+  if (param->sched_priority > 0)
+    {
+      ret = check_sched_priority_attr (param->sched_priority, policy);
+      if (ret)
+	return ret;
+    }
+
+  ret = check_cpuset_attr (real_in->cpuset, real_in->cpusetsize);
+  if (ret)
+    return ret;
+
+  /* stacksize == 0 is fine.  It means that we don't change the current
+     value.  */
+  if (real_in->stacksize != 0)
+    {
+      ret = check_stacksize_attr (real_in->stacksize);
+      if (ret)
+	return ret;
+    }
+
+  /* Having a default stack address is wrong.  */
+  if (real_in->flags & ATTR_FLAG_STACKADDR)
+    return EINVAL;
+
+  attrs = *real_in;
+
+  /* Now take the lock because we start writing into
+     __default_pthread_attr.  */
+  lll_lock (__default_pthread_attr_lock, LLL_PRIVATE);
+
+  /* Free the cpuset if the input is 0.  Otherwise copy in the cpuset
+     contents.  */
+  size_t cpusetsize = attrs.cpusetsize;
+  if (cpusetsize == 0)
+    {
+      free (__default_pthread_attr.cpuset);
+      __default_pthread_attr.cpuset = NULL;
+    }
+  else if (cpusetsize == __default_pthread_attr.cpusetsize)
+    {
+      attrs.cpuset = __default_pthread_attr.cpuset;
+      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
+    }
+  else
+    {
+      /* This may look wrong at first sight, but it isn't.  We're freeing
+	 __default_pthread_attr.cpuset and allocating to attrs.cpuset because
+	 we'll copy over all of attr to __default_pthread_attr later.  */
+      cpu_set_t *newp = realloc (__default_pthread_attr.cpuset,
+				 cpusetsize);
+
+      if (newp == NULL)
+	{
+	  ret = ENOMEM;
+	  goto out;
+	}
+
+      attrs.cpuset = newp;
+      memcpy (attrs.cpuset, real_in->cpuset, cpusetsize);
+    }
+
+  /* We don't want to accidentally set the default stacksize to zero.  */
+  if (attrs.stacksize == 0)
+    attrs.stacksize = __default_pthread_attr.stacksize;
+  __default_pthread_attr = attrs;
+
+ out:
+  lll_unlock (__default_pthread_attr_lock, LLL_PRIVATE);
+  return ret;
+}

Modified: fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h Sun Jun 16 00:02:12 2013
@@ -404,6 +404,14 @@
 					cpu_set_t *__cpuset)
      __THROW __nonnull ((1, 3));
 
+/* Get the default attributes used by pthread_create in this process.  */
+extern int pthread_getattr_default_np (pthread_attr_t *__attr)
+     __THROW __nonnull ((1));
+
+/* Set the default attributes to be used by pthread_create in this
+   process.  */
+extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
+     __THROW __nonnull ((1));
 
 /* Initialize thread attribute *ATTR with attributes corresponding to the
    already running thread TH.  It shall be called on uninitialized ATTR

Added: fsf/trunk/libc/nptl/tst-default-attr.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-default-attr.c (added)
+++ fsf/trunk/libc/nptl/tst-default-attr.c Sun Jun 16 00:02:12 2013
@@ -1,0 +1,385 @@
+/* Verify that pthread_[gs]etattr_default_np work correctly.
+
+   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/>.  */
+
+#include <pthread.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdbool.h>
+
+#define RETURN_IF_FAIL(f, ...) \
+  ({									      \
+    int ret = f (__VA_ARGS__);						      \
+    if (ret != 0)							      \
+      {									      \
+	printf ("%s:%d: %s returned %d (errno = %d)\n", __FILE__, __LINE__,   \
+		#f, ret, errno);					      \
+	return ret;							      \
+      }									      \
+  })
+
+static int (*verify_result) (pthread_attr_t *);
+static size_t stacksize = 1024 * 1024;
+static size_t guardsize;
+static bool do_join = true;
+static int running = 0;
+static int detach_failed = 0;
+static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
+
+static void *
+thr (void *unused __attribute__ ((unused)))
+{
+  pthread_attr_t attr;
+  int ret;
+
+  memset (&attr, 0xab, sizeof attr);
+  /* To verify that the pthread_setattr_default_np worked.  */
+  if ((ret = pthread_getattr_default_np (&attr)) != 0)
+    {
+      printf ("pthread_getattr_default_np failed: %s\n", strerror (ret));
+      goto out;
+    }
+
+  if ((ret = (*verify_result) (&attr)) != 0)
+    goto out;
+
+  memset (&attr, 0xab, sizeof attr);
+  /* To verify that the attributes actually got applied.  */
+  if ((ret = pthread_getattr_np (pthread_self (), &attr)) != 0)
+    {
+      printf ("pthread_getattr_default_np failed: %s\n", strerror (ret));
+      goto out;
+    }
+
+  ret = (*verify_result) (&attr);
+
+out:
+  if (!do_join)
+    {
+      pthread_mutex_lock (&m);
+      running--;
+      pthread_cond_signal (&c);
+      pthread_mutex_unlock (&m);
+
+      detach_failed |= ret;
+    }
+
+  return (void *) (uintptr_t) ret;
+}
+
+static int
+run_threads (const pthread_attr_t *attr)
+{
+  pthread_t t;
+  void *tret = NULL;
+
+  RETURN_IF_FAIL (pthread_setattr_default_np, attr);
+
+  /* Run twice to ensure that the attributes do not get overwritten in the
+     first run somehow.  */
+  for (int i = 0; i < 2; i++)
+    {
+      RETURN_IF_FAIL (pthread_create, &t, NULL, thr, NULL);
+      if (do_join)
+	RETURN_IF_FAIL (pthread_join, t, &tret);
+      else
+	{
+	  pthread_mutex_lock (&m);
+	  running++;
+	  pthread_mutex_unlock (&m);
+	}
+
+      if (tret != NULL)
+	{
+	  puts ("Thread failed");
+	  return 1;
+	}
+    }
+
+  /* Stay in sync for detached threads and get their status.  */
+  while (!do_join)
+    {
+      pthread_mutex_lock (&m);
+      if (running == 0)
+	{
+	  pthread_mutex_unlock (&m);
+	  break;
+	}
+      pthread_cond_wait (&c, &m);
+      pthread_mutex_unlock (&m);
+    }
+
+  return 0;
+}
+
+static int
+verify_detach_result (pthread_attr_t *attr)
+{
+  int state;
+
+  RETURN_IF_FAIL (pthread_attr_getdetachstate, attr, &state);
+
+  if (state != PTHREAD_CREATE_DETACHED)
+    {
+      puts ("failed to set detach state");
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+do_detach_test (void)
+{
+  pthread_attr_t attr;
+
+  do_join = false;
+  RETURN_IF_FAIL (pthread_attr_init, &attr);
+  RETURN_IF_FAIL (pthread_attr_setdetachstate, &attr, PTHREAD_CREATE_DETACHED);
+
+  RETURN_IF_FAIL (run_threads, &attr);
+  return detach_failed;
+}
+
+static int
+verify_affinity_result (pthread_attr_t *attr)
+{
+  cpu_set_t cpuset;
+
+  RETURN_IF_FAIL (pthread_attr_getaffinity_np, attr, sizeof (cpuset), &cpuset);
+  if (!CPU_ISSET (0, &cpuset))
+    {
+      puts ("failed to set cpu affinity");
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+do_affinity_test (void)
+{
+  pthread_attr_t attr;
+
+  RETURN_IF_FAIL (pthread_attr_init, &attr);
+
+  /* Processor affinity.  Like scheduling policy, this could fail if the user
+     does not have the necessary privileges.  So we only spew a warning if
+     pthread_create fails with EPERM.  A computer has at least one CPU.  */
+  cpu_set_t cpuset;
+  CPU_ZERO (&cpuset);
+  CPU_SET (0, &cpuset);
+  RETURN_IF_FAIL (pthread_attr_setaffinity_np, &attr, sizeof (cpuset), &cpuset);
+
+  int ret = run_threads (&attr);
+
+  if (ret == EPERM)
+    {
+      printf ("Skipping CPU Affinity test: %s\n", strerror (ret));
+      return 0;
+    }
+  else if (ret != 0)
+    return ret;
+
+  return 0;
+}
+
+static int
+verify_sched_result (pthread_attr_t *attr)
+{
+  int inherited, policy;
+  struct sched_param param;
+
+  RETURN_IF_FAIL (pthread_attr_getinheritsched, attr, &inherited);
+  if (inherited != PTHREAD_EXPLICIT_SCHED)
+    {
+      puts ("failed to set EXPLICIT_SCHED (%d != %d)");
+      return 1;
+    }
+
+  RETURN_IF_FAIL (pthread_attr_getschedpolicy, attr, &policy);
+  if (policy != SCHED_RR)
+    {
+      printf ("failed to set SCHED_RR (%d != %d)\n", policy, SCHED_RR);
+      return 1;
+    }
+
+  RETURN_IF_FAIL (pthread_attr_getschedparam, attr, &param);
+  if (param.sched_priority != 42)
+    {
+      printf ("failed to set sched_priority (%d != %d)\n",
+	      param.sched_priority, 42);
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+do_sched_test (void)
+{
+  pthread_attr_t attr;
+
+  RETURN_IF_FAIL (pthread_attr_init, &attr);
+
+  /* Scheduling policy.  Note that we don't always test these since it's
+     possible that the user the tests run as don't have the appropriate
+     privileges.  */
+  RETURN_IF_FAIL (pthread_attr_setinheritsched, &attr, PTHREAD_EXPLICIT_SCHED);
+  RETURN_IF_FAIL (pthread_attr_setschedpolicy, &attr, SCHED_RR);
+
+  struct sched_param param;
+  param.sched_priority = 42;
+  RETURN_IF_FAIL (pthread_attr_setschedparam, &attr, &param);
+
+  int ret = run_threads (&attr);
+
+  if (ret == EPERM)
+    {
+      printf ("Skipping Scheduler Attributes test: %s\n", strerror (ret));
+      return 0;
+    }
+  else if (ret != 0)
+    return ret;
+
+  return 0;
+}
+
+static int
+verify_guardsize_result (pthread_attr_t *attr)
+{
+  size_t guard;
+
+  RETURN_IF_FAIL (pthread_attr_getguardsize, attr, &guard);
+
+  if (guardsize != guard)
+    {
+      printf ("failed to set guardsize (%zu, %zu)\n", guardsize, guard);
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+do_guardsize_test (void)
+{
+  long int pagesize = sysconf (_SC_PAGESIZE);
+  pthread_attr_t attr;
+
+  if (pagesize < 0)
+    {
+      printf ("sysconf failed: %s\n", strerror (errno));
+      return 1;
+    }
+
+  RETURN_IF_FAIL (pthread_getattr_default_np, &attr);
+
+  /* Increase default guardsize by a page.  */
+  RETURN_IF_FAIL (pthread_attr_getguardsize, &attr, &guardsize);
+  guardsize += pagesize;
+  RETURN_IF_FAIL (pthread_attr_setguardsize, &attr, guardsize);
+  RETURN_IF_FAIL (run_threads, &attr);
+
+  return 0;
+}
+
+static int
+verify_stacksize_result (pthread_attr_t *attr)
+{
+  size_t stack;
+
+  RETURN_IF_FAIL (pthread_attr_getstacksize, attr, &stack);
+
+  if (stacksize != stack)
+    {
+      printf ("failed to set default stacksize (%zu, %zu)\n", stacksize, stack);
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+do_stacksize_test (void)
+{
+  long int pagesize = sysconf (_SC_PAGESIZE);
+  pthread_attr_t attr;
+
+  if (pagesize < 0)
+    {
+      printf ("sysconf failed: %s\n", strerror (errno));
+      return 1;
+    }
+
+  /* Perturb the size by a page so that we're not aligned on the 64K boundary.
+     pthread_create does this perturbation on x86 to avoid causing the 64k
+     aliasing conflict.  We want to prevent pthread_create from doing that
+     since it is not consistent for all architectures.  */
+  stacksize += pagesize;
+
+  RETURN_IF_FAIL (pthread_attr_init, &attr);
+
+  /* Run twice to ensure that we don't give a false positive.  */
+  RETURN_IF_FAIL (pthread_attr_setstacksize, &attr, stacksize);
+  RETURN_IF_FAIL (run_threads, &attr);
+  stacksize *= 2;
+  RETURN_IF_FAIL (pthread_attr_setstacksize, &attr, stacksize);
+  RETURN_IF_FAIL (run_threads, &attr);
+  return 0;
+}
+
+/* We test each attribute separately because sched and affinity tests may need
+   additional user privileges that may not be available during the test run.
+   Each attribute test is a set of two functions, viz. a function to set the
+   default attribute (do_foo_test) and another to verify its result
+   (verify_foo_result).  Each test spawns a thread and checks (1) if the
+   attribute values were applied correctly and (2) if the change in the default
+   value reflected.  */
+static int
+do_test (void)
+{
+  puts ("stacksize test");
+  verify_result = verify_stacksize_result;
+  RETURN_IF_FAIL (do_stacksize_test);
+
+  puts ("guardsize test");
+  verify_result = verify_guardsize_result;
+  RETURN_IF_FAIL (do_guardsize_test);
+
+  puts ("sched test");
+  verify_result = verify_sched_result;
+  RETURN_IF_FAIL (do_sched_test);
+
+  puts ("affinity test");
+  verify_result = verify_affinity_result;
+  RETURN_IF_FAIL (do_affinity_test);
+
+  puts ("detach test");
+  verify_result = verify_detach_result;
+  RETURN_IF_FAIL (do_detach_test);
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/nptl/vars.c
==============================================================================
--- fsf/trunk/libc/nptl/vars.c (original)
+++ fsf/trunk/libc/nptl/vars.c Sun Jun 16 00:02:12 2013
@@ -24,6 +24,9 @@
    provide any.  */
 struct pthread_attr __default_pthread_attr attribute_hidden;
 
+/* Mutex protecting __default_pthread_attr.  */
+int __default_pthread_attr_lock = LLL_LOCK_INITIALIZER;
+
 /* Flag whether the machine is SMP or not.  */
 int __is_smp attribute_hidden;
 

Modified: fsf/trunk/libc/ports/ChangeLog.aarch64
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.aarch64 (original)
+++ fsf/trunk/libc/ports/ChangeLog.aarch64 Sun Jun 16 00:02:12 2013
@@ -1,3 +1,8 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist:
+	Update.
+
 2013-06-04  Marcus Shawcroft  <marcus.shawcroft@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/aarch64/getcontext.S (__getcontext):

Modified: fsf/trunk/libc/ports/ChangeLog.alpha
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.alpha (original)
+++ fsf/trunk/libc/ports/ChangeLog.alpha Sun Jun 16 00:02:12 2013
@@ -1,3 +1,7 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist: Update.
+
 2013-06-05  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/alpha/bits/atomic.h: Remove trailing whitespace.

Modified: fsf/trunk/libc/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.arm (original)
+++ fsf/trunk/libc/ports/ChangeLog.arm Sun Jun 16 00:02:12 2013
@@ -1,3 +1,7 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist: Update.
+
 2013-06-14  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #15492]

Modified: fsf/trunk/libc/ports/ChangeLog.ia64
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.ia64 (original)
+++ fsf/trunk/libc/ports/ChangeLog.ia64 Sun Jun 16 00:02:12 2013
@@ -1,3 +1,7 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist: Update.
+
 2013-06-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/ia64/getpagesize.c (__getpagesize): Use

Modified: fsf/trunk/libc/ports/ChangeLog.m68k
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.m68k (original)
+++ fsf/trunk/libc/ports/ChangeLog.m68k Sun Jun 16 00:02:12 2013
@@ -1,3 +1,10 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist:
+	Likewise.
+
 2013-06-08  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/m68k/getpagesize.c (__getpagesize): Use

Modified: fsf/trunk/libc/ports/ChangeLog.microblaze
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.microblaze (original)
+++ fsf/trunk/libc/ports/ChangeLog.microblaze Sun Jun 16 00:02:12 2013
@@ -1,3 +1,8 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/microblaze/nptl/libpthread.abilist:
+	Update.
+
 2013-06-14  David Holsgrove <david.holsgrove@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/microblaze/nptl/lowlevellock.h: Correct

Modified: fsf/trunk/libc/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.mips (original)
+++ fsf/trunk/libc/ports/ChangeLog.mips Sun Jun 16 00:02:12 2013
@@ -1,3 +1,12 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist:
+	Likewise.
+
 2013-06-14  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	[BZ #14909]

Modified: fsf/trunk/libc/ports/ChangeLog.powerpc
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.powerpc (original)
+++ fsf/trunk/libc/ports/ChangeLog.powerpc Sun Jun 16 00:02:12 2013
@@ -1,3 +1,8 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist:
+	Update.
+
 2013-06-11  Ryan S. Arnold  <rsa@xxxxxxxxxxxxxxxxxx>
 
 	* sysdeps/powerpc/dl-procinfo.c: Remove as this is now redundant with

Modified: fsf/trunk/libc/ports/ChangeLog.tile
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.tile (original)
+++ fsf/trunk/libc/ports/ChangeLog.tile Sun Jun 16 00:02:12 2013
@@ -1,3 +1,12 @@
+2013-06-15  Siddhesh Poyarekar  <siddhesh@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist:
+	Update.
+	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist:
+	Likewise.
+	* sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist:
+	Likewise.
+
 2013-06-12  Chris Metcalf  <cmetcalf@xxxxxxxxxx>
 
 	* sysdeps/tile/bits/endian.h (__BYTE_ORDER): Default to little.

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/aarch64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -222,3 +222,7 @@
  wait F
  waitpid F
  write F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/alpha/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/arm/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.4
  GLIBC_2.4 A
  _IO_flockfile F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/ia64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_flockfile F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/coldfire/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.4
  GLIBC_2.4 A
  _IO_flockfile F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/m68k/m680x0/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/microblaze/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/microblaze/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/microblaze/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -120,6 +120,7 @@
  pthread_equal F
  pthread_exit F
  pthread_getaffinity_np F
+ pthread_getattr_default_np F
  pthread_getattr_np F
  pthread_getconcurrency F
  pthread_getcpuclockid F
@@ -175,6 +176,7 @@
  pthread_rwlockattr_setpshared F
  pthread_self F
  pthread_setaffinity_np F
+ pthread_setattr_default_np F
  pthread_setcancelstate F
  pthread_setcanceltype F
  pthread_setconcurrency F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -130,6 +130,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __libc_allocate_rtsig F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -130,6 +130,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __libc_allocate_rtsig F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/mips/mips64/n64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -130,6 +130,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __libc_allocate_rtsig F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -222,3 +222,7 @@
  wait F
  waitpid F
  write F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -222,3 +222,7 @@
  wait F
  waitpid F
  write F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F

Modified: fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/ports/sysdeps/unix/sysv/linux/tile/tilepro/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -222,3 +222,7 @@
  wait F
  waitpid F
  write F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F

Modified: fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_sqrt.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_sqrt.c (original)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/e_sqrt.c Sun Jun 16 00:02:12 2013
@@ -63,6 +63,9 @@
   s=a.x;
   /*----------------- 2^-1022  <= | x |< 2^1024  -----------------*/
   if (k>0x000fffff && k<0x7ff00000) {
+    fenv_t env;
+    libc_feholdexcept (&env);
+    double ret;
     y=1.0-t*(t*s);
     t=t*(rt0+y*(rt1+y*(rt2+y*rt3)));
     c.i[HIGH_HALF]=0x20000000+((k&0x7fe00000)>>1);
@@ -70,12 +73,22 @@
     hy=(y+big)-big;
     del=0.5*t*((s-hy*hy)-(y-hy)*(y+hy));
     res=y+del;
-    if (res == (res+1.002*((y-res)+del))) return res*c.x;
+    if (res == (res+1.002*((y-res)+del))) ret = res*c.x;
     else {
       res1=res+1.5*((y-res)+del);
       EMULV(res,res1,z,zz,p,hx,tx,hy,ty);  /* (z+zz)=res*res1 */
-      return ((((z-s)+zz)<0)?max(res,res1):min(res,res1))*c.x;
+      ret = ((((z-s)+zz)<0)?max(res,res1):min(res,res1))*c.x;
     }
+    math_force_eval (ret);
+    libc_fesetenv (&env);
+    if (x / ret != ret)
+      {
+	double force_inexact = 1.0 / 3.0;
+	math_force_eval (force_inexact);
+      }
+    /* Otherwise (x / ret == ret), either the square root was exact or
+       the division was inexact.  */
+    return ret;
   }
   else {
     if ((k & 0x7ff00000) == 0x7ff00000)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.3
  GLIBC_2.3 A
  _IO_flockfile F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/s390/s390-64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_flockfile F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sh/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_flockfile F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -174,6 +174,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  __open64 F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2
  GLIBC_2.2 A
  _IO_flockfile F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/64/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -8,6 +8,10 @@
  pthread_mutexattr_getrobust F
  pthread_mutexattr_setrobust F
  pthread_setname_np F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F
 GLIBC_2.2.5
  GLIBC_2.2.5 A
  _IO_flockfile F

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/x32/nptl/libpthread.abilist Sun Jun 16 00:02:12 2013
@@ -222,3 +222,7 @@
  wait F
  waitpid F
  write F
+GLIBC_2.18
+ GLIBC_2.18 A
+ pthread_getattr_default_np F
+ pthread_setattr_default_np F

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