Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 17 Sep 2003 19:15:35 +0000 (19:15 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 17 Sep 2003 19:15:35 +0000 (19:15 +0000)
* elf/Makefile (distribute): Add tst-alignmod.c.
(tests): Add tst-align.
(modules-names): Add tst-alignmod.
(CFLAGS-tst-align.c, CFLAGS-tst-alignmod.c): Add
$(stack-align-test-flags).
($(objpfx)tst-align): Depend on libdl.
($(objpfx)tst-align.out): Depend on tst-alignmod.so.
* elf/tst-align.c: New file.
* elf/tst-alignmod.c: New file.
* misc/Makefile (CFLAGS-tst-tsearch.c): Add $(stack-align-test-flags).
* misc/tst-tsearch.c: Include tst-stack-align.h.
(stack_align_check): New array.
(cmp_fn, walk_action): Use TEST_STACK_ALIGN ().
(main): Report error if stack was not enough aligned
in cmp_fn or walk_action.
* stdlib/Makefile (CFLAGS-tst-qsort.c): Add $(stack-align-test-flags).
* stdlib/tst-qsort.c: Include tst-stack-align.h.
(align_check): New var.
(compare): Use TEST_STACK_ALIGN () macro.
(main): Report error if stack was not enough aligned in compare.
* sysdeps/i386/i686/Makefile (stack-align-test-flags): Remove
unneeded -mpreferred-stack-boundary=4.
* sysdeps/x86_64/tst-stack-align.h: New file.

* libio/memstream.c (_IO_wmem_jumps): Remove unused structure.
(_IO_wmem_sync, _IO_wmem_finish): Remove unused functions.

2003-09-17  Philip Blundell  <philb@gnu.org>

* sysdeps/arm/dl-machine.h (CALL_ROUTINE): Deleted.
(BX): Define.
(ELF_MACHINE_RUNTIME_TRAMPOLINE): Optimise a little.

* sysdeps/arm/sysdep.h (DO_RET): New.

* sysdeps/unix/sysv/linux/arm/vfork.S: Add #error if __NR_vfork
required but not defined.  Improve test of error code.

2003-09-17  Jakub Jelinek  <jakub@redhat.com>

ChangeLog
nptl/ChangeLog
nptl/sysdeps/pthread/pthread.h
nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c

index 4ba2bcb..7de86d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,45 @@
 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
 
+       * elf/Makefile (distribute): Add tst-alignmod.c.
+       (tests): Add tst-align.
+       (modules-names): Add tst-alignmod.
+       (CFLAGS-tst-align.c, CFLAGS-tst-alignmod.c): Add
+       $(stack-align-test-flags).
+       ($(objpfx)tst-align): Depend on libdl.
+       ($(objpfx)tst-align.out): Depend on tst-alignmod.so.
+       * elf/tst-align.c: New file.
+       * elf/tst-alignmod.c: New file.
+       * misc/Makefile (CFLAGS-tst-tsearch.c): Add $(stack-align-test-flags).
+       * misc/tst-tsearch.c: Include tst-stack-align.h.
+       (stack_align_check): New array.
+       (cmp_fn, walk_action): Use TEST_STACK_ALIGN ().
+       (main): Report error if stack was not enough aligned
+       in cmp_fn or walk_action.
+       * stdlib/Makefile (CFLAGS-tst-qsort.c): Add $(stack-align-test-flags).
+       * stdlib/tst-qsort.c: Include tst-stack-align.h.
+       (align_check): New var.
+       (compare): Use TEST_STACK_ALIGN () macro.
+       (main): Report error if stack was not enough aligned in compare.
+       * sysdeps/i386/i686/Makefile (stack-align-test-flags): Remove
+       unneeded -mpreferred-stack-boundary=4.
+       * sysdeps/x86_64/tst-stack-align.h: New file.
+
+       * libio/memstream.c (_IO_wmem_jumps): Remove unused structure.
+       (_IO_wmem_sync, _IO_wmem_finish): Remove unused functions.
+
+2003-09-17  Philip Blundell  <philb@gnu.org>
+
+       * sysdeps/arm/dl-machine.h (CALL_ROUTINE): Deleted.
+       (BX): Define.
+       (ELF_MACHINE_RUNTIME_TRAMPOLINE): Optimise a little.
+
+       * sysdeps/arm/sysdep.h (DO_RET): New.
+
+       * sysdeps/unix/sysv/linux/arm/vfork.S: Add #error if __NR_vfork
+       required but not defined.  Improve test of error code.
+
+2003-09-17  Jakub Jelinek  <jakub@redhat.com>
+
        * sysdeps/i386/Makefile (stack-align-test-flags): Add
        -malign-double -mpreferred-stack-boundary=4.
 
index e7341f1..bb73d0f 100644 (file)
@@ -1,5 +1,9 @@
 2003-09-17  Jakub Jelinek  <jakub@redhat.com>
 
+       * sysdeps/pthread/pthread.h (pthread_getattr_np): Clarify usage.
+       * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
+       (pthread_attr_setaffinity_np): Handle cpuset == NULL.
+
        * sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c
        (pthread_attr_getaffinity_np): Don't segfault if iattr->cpuset is
        NULL.
index af0a22a..6e8da67 100644 (file)
@@ -334,7 +334,9 @@ extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
                                        cpu_set_t *__cpuset) __THROW;
 
 
-/* Get thread attributes corresponding to the already running thread TH.  */
+/* Initialize thread attribute *ATTR with attributes corresponding to the
+   already running thread TH.  It shall be called on unitialized ATTR
+   and destroyed with pthread_attr_destroy when no longer needed.  */
 extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
 #endif
 
index f25ccb2..de8f54f 100644 (file)
@@ -34,14 +34,22 @@ pthread_attr_setaffinity_np (attr, cpuset)
   assert (sizeof (*attr) >= sizeof (struct pthread_attr));
   iattr = (struct pthread_attr *) attr;
 
-  if (iattr->cpuset == NULL)
+  if (cpuset == NULL)
     {
-      iattr->cpuset = (cpu_set_t *) malloc (sizeof (cpu_set_t));
-      if (iattr->cpuset == NULL)
-       return ENOMEM;
+      free (iattr->cpuset);
+      iattr->cpuset = NULL;
     }
+  else
+    {
+      if (iattr->cpuset == NULL)
+       {
+         iattr->cpuset = (cpu_set_t *) malloc (sizeof (cpu_set_t));
+         if (iattr->cpuset == NULL)
+           return ENOMEM;
+       }
 
-  memcpy (iattr->cpuset, cpuset, sizeof (cpu_set_t));
+      memcpy (iattr->cpuset, cpuset, sizeof (cpu_set_t));
+    }
 
   return 0;
 }