]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20090108T1017 cvs/fedora-glibc-2_9_90-2
authorJakub Jelinek <jakub@redhat.com>
Thu, 8 Jan 2009 10:27:05 +0000 (10:27 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 8 Jan 2009 10:27:05 +0000 (10:27 +0000)
36 files changed:
ChangeLog
bits/resource.h
fedora/branch.mk
fedora/glibc.spec.in
hurd/hurdsig.c
hurd/report-wait.c
localedata/locales/bn_BD
nptl/ChangeLog
nptl/allocatestack.c
nptl/init.c
nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
posix/bug-regex17.c
posix/regcomp.c
posix/regex_internal.c
posix/regex_internal.h
posix/regexec.c
posix/rxspencer/tests
resolv/nss_dns/dns-host.c
sysdeps/mach/hurd/Makefile
sysdeps/unix/sysv/linux/bits/resource.h
sysdeps/unix/sysv/linux/i386/sysdep.h
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/s390/Makefile
sysdeps/unix/sysv/linux/s390/Versions [new file with mode: 0644]
sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/s390/gettimeofday.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/s390/init-first.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
sysdeps/unix/sysv/linux/sparc/bits/resource.h

index d0e5dff51b0fbda0196904e1333d13615ffa687b..cf23772cff4ce3564edc4131388b60f78cdeb5f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,77 @@
+2009-01-08  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #9720]
+       * sysdeps/unix/sysv/linux/bits/resource.h (enum __rusage_who): Avoid
+       comma after RUSAGE_CHILDREN if not -D_GNU_SOURCE.
+       * sysdeps/unix/sysv/linux/sparc/bits/resource.h (enum __rusage_who):
+       Likewise.
+
+2009-01-05  Paolo Bonzini  <bonzini@gnu.org>
+
+       [BZ 697]
+       * posix/regexec.c (prune_impossible_nodes): Handle sifted_states[0]
+       being NULL also if there are no backreferences.
+       * posix/rxspencer/tests: Add testcases.
+
+2009-01-04  Paolo Bonzini  <bonzini@gnu.org>
+
+       [BZ 9697]
+       * posix/bug-regex17.c: Add testcases.
+       * posix/regcomp.c (re_compile_fastmap_iter): Rewrite COMPLEX_BRACKET
+       handling.
+
+2009-01-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+       * sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h: New file.
+       * sysdeps/unix/sysv/linux/s390/gettimeofday.c: New file.
+       * sysdeps/unix/sysv/linux/s390/init-first.c: New file.
+       * sysdeps/unix/sysv/linux/s390/Makefile (sysdep_routines): Add dl-vdso
+       for elf subdir.
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h (INLINE_VSYSCALL,
+       INTERNAL_VSYSCALL, INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK,
+       INTERNAL_SYSCALL_NCS, HAVE_CLOCK_GETRES_VSYSCALL and
+       HAVE_CLOCK_GETTIME_VSYSCALL: Define.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/Versions: New file.
+
+2008-12-31  Paolo Bonzini  <bonzini@gnu.org>
+
+       * posix/regcomp.c (re_compile_fastmap_iter): Use __mbrtowc.
+       * posix/regex_internal.c (build_wcs_buffer, build_wcs_upper_buffer,
+       re_string_skip_chars, re_string_reconstruct): Likewise.
+       * posix/regex_internal.h [!_LIBC] (__mbrtowc): New #define.
+
+2008-12-31  Rafael Avila de Espindola  <espindola@google.com>
+
+       * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyaddr2_r): Check and
+       adjust the buffer alignment.
+
+2009-01-07  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+       * sysdeps/mach/hurd/Makefile (sysdep_headers) [subdir=socket]:
+       Add net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h
+       net/route.h.
+
+       * hurd/report-wait.c (describe_number): Use __stpcpy to prepend
+       flavor to description only when flavor is not NULL.
+
+       * hurd/hurdsig.c (signal_allowed): Unlock _hurd_dtable_lock
+       mutex after SIGIO/SIGURG lookup loop.
+
+2009-01-03  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+       * bits/resource.h (PRIO_PROCESS, PRIO_PGRP, PRIO_USER): Add macros.
+
+2009-01-03  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/i386/sysdep.h: Describe 6th argument
+       handling.
+
 2009-01-02  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/unix/sysv/linux/kernel-features.h
+       (__ASSUME_FUTEX_CLOCK_REALTIME): Define.
+
        * wcsmbs/wcsnrtombs.c (__wcsnrtombs): Create temporary state object
        if no output is written.
 
index 8057f5cc657005bdc89fae39fd7d5008c6553a43..ef718db0bc37484bacf635e509023a4fcb40c92e 100644 (file)
@@ -185,6 +185,9 @@ struct rusage
 enum __priority_which
   {
     PRIO_PROCESS = 0,           /* WHO is a process ID.  */
+#define PRIO_PROCESS PRIO_PROCESS
     PRIO_PGRP = 1,              /* WHO is a process group ID.  */
+#define PRIO_PGRP PRIO_PGRP
     PRIO_USER = 2               /* WHO is a user ID.  */
+#define PRIO_USER PRIO_USER
   };
index e7a216630215c4fcffb5fbb7058701b1a0bf3c4e..ab7838aba843a2ebb88635dbfb23686c27508642 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-f8
-fedora-sync-date := 2009-01-02 21:10 UTC
-fedora-sync-tag := fedora-glibc-20090102T2110
+fedora-sync-date := 2009-01-08 10:17 UTC
+fedora-sync-tag := fedora-glibc-20090108T1017
index dad5523130198d6e2309cb74ddc02fe73a929ccf..5537f3b4486c69fdb047bd2df63386477f958511 100644 (file)
@@ -19,7 +19,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: @glibcversion@
-Release: 1
+Release: 2
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -984,6 +984,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Thu Jan  8 2009 Jakub Jelinek <jakub@redhat.com> 2.9.90-2
+- update from trunk
+
 * Fri Jan  2 2009 Jakub Jelinek <jakub@redhat.com> 2.9.90-1
 - update from trunk (#478314)
 
index 27050c99d948ffa4439e32bf48d2847aed060f8b..7a6b1d50c45120688be2b77192bb6f097d8366b4 100644 (file)
@@ -1134,6 +1134,7 @@ signal_allowed (int signo, mach_port_t refport)
              }
            _hurd_port_free (&_hurd_dtable[d]->port, &ulink, port);
          }
+       __mutex_unlock (&_hurd_dtable_lock);
        /* If we found a lucky winner, we've set D to -1 in the loop.  */
        if (lucky)
          goto win;
index 296b2eec42b3c82cf0da49366a555f1da65c04ff..f6e48f951edc3fbb1f2e5d49855741314fc27d07 100644 (file)
@@ -1,5 +1,5 @@
 /* Report on what a thread in our task is waiting for.
-   Copyright (C) 1996,1997,1999,2002,2005 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,1999,2002,2005,2009 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
@@ -30,7 +30,7 @@ static char *
 describe_number (string_t description, const char *flavor, long int i)
 {
   unsigned long int j;
-  char *p = flavor ? description : __stpcpy (description, flavor);
+  char *p = flavor == NULL ? description : __stpcpy (description, flavor);
   char *end;
 
   /* Handle sign.  */
index dfbe47f05004058fab3d61ff2702108eb28c0385..dceacc34ad44624c49df69dfe09afb3c14d41cc9 100644 (file)
@@ -37,7 +37,7 @@ copy "iso14651_t1"
 END LC_COLLATE
 
 LC_CTYPE
-copy "i18n"
+copy "bn_IN"
 
 translit_start
 include "translit_combining";""
index bc37402583daf029e4225fba2a546e5f2ac00430..e3c752ee631a1c61f9db936f6ea09b0bfce3ceef 100644 (file)
@@ -1,3 +1,32 @@
+2009-01-04  Ulrich Drepper  <drepper@redhat.com>
+
+       * init.c (__pthread_initialize_minimal_internal): Optimize test
+       FUTEX_CLOCK_REALTIME a bit.
+
+2009-01-03  Ulrich Drepper  <drepper@redhat.com>
+
+       * init.c (__pthread_initialize_minimal_internal): Cheat a bit by
+       only passing five parameters to FUTEX_WAIT_BITSET call.
+
+       * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
+       (__lll_timedlock_wait): Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME
+       instead of computing relative timeout.
+
+2009-01-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * init.c (__pthread_initialize_minimal_internal): Check for
+       FUTEX_CLOCK_REALTIME flag.
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (__lll_timedlock_wait):
+       Use FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME instead of computing
+       relative timeout.
+
+       * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Define
+       FUTEX_CLOCK_REALTIME and FUTEX_BITSET_MATCH_ANY.
+       * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
+
 2008-12-09  Ulrich Drepper  <drepper@redhat.com>
 
        * sysdeps/pthread/pthread.h (pthread_cleanup_pop): Use { } as empty
index 9ab4d6281c7450ba26b933d807773b88d390c36c..ce05770e56569d9283a6f8fac586e477539efe7c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -112,6 +112,11 @@ static LIST_HEAD (stack_cache);
 /* List of the stacks in use.  */
 static LIST_HEAD (stack_used);
 
+/* We need to record what list operations we are going to do so that,
+   in case of an asynchronous interruption due to a fork() call, we
+   can correct for the work.  */
+static uintptr_t in_flight_stack;
+
 /* List of the threads with user provided stacks in use.  No need to
    initialize this, since it's done in __pthread_initialize_minimal.  */
 list_t __stack_user __attribute__ ((nocommon));
@@ -127,6 +132,36 @@ static unsigned int nptl_ncreated;
 #define FREE_P(descr) ((descr)->tid <= 0)
 
 
+static void
+stack_list_del (list_t *elem)
+{
+  in_flight_stack = (uintptr_t) elem;
+
+  atomic_write_barrier ();
+
+  list_del (elem);
+
+  atomic_write_barrier ();
+
+  in_flight_stack = 0;
+}
+
+
+static void
+stack_list_add (list_t *elem, list_t *list)
+{
+  in_flight_stack = (uintptr_t) elem | 1;
+
+  atomic_write_barrier ();
+
+  list_add (elem, list);
+
+  atomic_write_barrier ();
+
+  in_flight_stack = 0;
+}
+
+
 /* We create a double linked list of all cache entries.  Double linked
    because this allows removing entries from the end.  */
 
@@ -179,10 +214,10 @@ get_cached_stack (size_t *sizep, void **memp)
     }
 
   /* Dequeue the entry.  */
-  list_del (&result->list);
+  stack_list_del (&result->list);
 
   /* And add to the list of stacks in use.  */
-  list_add (&result->list, &stack_used);
+  stack_list_add (&result->list, &stack_used);
 
   /* And decrease the cache size.  */
   stack_cache_actsize -= result->stackblock_size;
@@ -230,7 +265,7 @@ free_stacks (size_t limit)
       if (FREE_P (curr))
        {
          /* Unlink the block.  */
-         list_del (entry);
+         stack_list_del (entry);
 
          /* Account for the freed memory.  */
          stack_cache_actsize -= curr->stackblock_size;
@@ -260,7 +295,7 @@ queue_stack (struct pthread *stack)
   /* We unconditionally add the stack to the list.  The memory may
      still be in use but it will not be reused until the kernel marks
      the stack as not used anymore.  */
-  list_add (&stack->list, &stack_cache);
+  stack_list_add (&stack->list, &stack_cache);
 
   stack_cache_actsize += stack->stackblock_size;
   if (__builtin_expect (stack_cache_actsize > stack_cache_maxsize, 0))
@@ -547,7 +582,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
          lll_lock (stack_cache_lock, LLL_PRIVATE);
 
          /* And add to the list of stacks in use.  */
-         list_add (&pd->list, &stack_used);
+         stack_list_add (&pd->list, &stack_used);
 
          lll_unlock (stack_cache_lock, LLL_PRIVATE);
 
@@ -601,7 +636,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
              lll_lock (stack_cache_lock, LLL_PRIVATE);
 
              /* Remove the thread from the list.  */
-             list_del (&pd->list);
+             stack_list_del (&pd->list);
 
              lll_unlock (stack_cache_lock, LLL_PRIVATE);
 
@@ -703,7 +738,7 @@ __deallocate_stack (struct pthread *pd)
 
   /* Remove the thread from the list of threads with user defined
      stacks.  */
-  list_del (&pd->list);
+  stack_list_del (&pd->list);
 
   /* Not much to do.  Just free the mmap()ed memory.  Note that we do
      not reset the 'used' flag in the 'tid' field.  This is done by
@@ -776,7 +811,47 @@ __reclaim_stacks (void)
 {
   struct pthread *self = (struct pthread *) THREAD_SELF;
 
-  /* No locking necessary.  The caller is the only stack in use.  */
+  /* No locking necessary.  The caller is the only stack in use.  But
+     we have to be aware that we might have interrupted a list
+     operation.  */
+
+  if (in_flight_stack != 0)
+    {
+      bool add_p = in_flight_stack & 1;
+      list_t *elem = (list_t *) (in_flight_stack & ~UINTMAX_C (1));
+
+      if (add_p)
+       {
+         /* We always add at the beginning of the list.  So in this
+            case we only need to check the beginning of these lists.  */
+         int check_list (list_t *l)
+         {
+           if (l->next->prev != l)
+             {
+               assert (l->next->prev == elem);
+
+               elem->next = l->next;
+               elem->prev = l;
+               l->next = elem;
+
+               return 1;
+             }
+
+           return 0;
+         }
+
+         if (check_list (&stack_used) == 0)
+           (void) check_list (&stack_cache);
+       }
+      else
+       {
+         /* We can simply always replay the delete operation.  */
+         elem->next->prev = elem->prev;
+         elem->prev->next = elem->next;
+       }
+
+      in_flight_stack = 0;
+    }
 
   /* Mark all stacks except the still running one as free.  */
   list_t *runp;
@@ -829,7 +904,7 @@ __reclaim_stacks (void)
   /* Remove the entry for the current thread to from the cache list
      and add it to the list of running threads.  Which of the two
      lists is decided by the user_stack flag.  */
-  list_del (&self->list);
+  stack_list_del (&self->list);
 
   /* Re-initialize the lists for all the threads.  */
   INIT_LIST_HEAD (&stack_used);
@@ -838,7 +913,7 @@ __reclaim_stacks (void)
   if (__builtin_expect (THREAD_GETMEM (self, user_stack), 0))
     list_add (&self->list, &__stack_user);
   else
-    list_add (&self->list, &stack_used);
+    stack_list_add (&self->list, &stack_used);
 
   /* There is one thread running.  */
   __nptl_nthreads = 1;
index d445de0795390d9472ce82c0b312d666b951cf8d..7a6dec593576b5c34b616bfeead13bc45fc22fc5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <assert.h>
+#include <errno.h>
 #include <limits.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -49,6 +50,15 @@ int __set_robust_list_avail;
 # define set_robust_list_not_avail() do { } while (0)
 #endif
 
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+/* Nonzero if we do not have FUTEX_CLOCK_REALTIME.  */
+int __have_futex_clock_realtime;
+# define __set_futex_clock_realtime() \
+  __have_futex_clock_realtime = 1
+#else
+#define __set_futex_clock_realtime() do { } while (0)
+#endif
+
 /* Version of the library, used in libthread_db to detect mismatches.  */
 static const char nptl_version[] __attribute_used__ = VERSION;
 
@@ -290,6 +300,28 @@ __pthread_initialize_minimal_internal (void)
     if (!INTERNAL_SYSCALL_ERROR_P (word, err))
       THREAD_SETMEM (pd, header.private_futex, FUTEX_PRIVATE_FLAG);
   }
+
+  /* Private futexes have been introduced earlier than the
+     FUTEX_CLOCK_REALTIME flag.  We don't have to run the test if we
+     know the former are not supported.  This also means we know the
+     kernel will return ENOSYS for unknown operations.  */
+  if (THREAD_GETMEM (pd, header.private_futex) != 0)
+#endif
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+    {
+      int word = 0;
+      /* NB: the syscall actually takes six parameters.  The last is the
+        bit mask.  But since we will not actually wait at all the value
+        is irrelevant.  Given that passing six parameters is difficult
+        on some architectures we just pass whatever random value the
+        calling convention calls for to the kernel.  It causes no harm.  */
+      word = INTERNAL_SYSCALL (futex, err, 5, &word,
+                              FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME
+                              | FUTEX_PRIVATE_FLAG, 1, NULL, 0);
+      assert (INTERNAL_SYSCALL_ERROR_P (word, err));
+      if (INTERNAL_SYSCALL_ERRNO (word, err) != ENOSYS)
+       __set_futex_clock_realtime ();
+    }
 #endif
 
   /* Set initial thread's stack block from 0 up to __libc_stack_end.
index 9c8a68f5b2d10ef9db0b7aec7738475a49767eea..056b72900aace69b5e0ae4470680f352821b3639 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -31,6 +31,8 @@
        movl    $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
 # define LOAD_FUTEX_WAIT(reg) \
        xorl    $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
+# define LOAD_FUTEX_WAIT_ABS(reg) \
+       xorl    $(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
 # define LOAD_FUTEX_WAKE(reg) \
        xorl    $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
 #else
        andl    %gs:PRIVATE_FUTEX, reg ; \
        orl     $FUTEX_WAIT, reg
 # endif
+# define LOAD_FUTEX_WAIT_ABS(reg) \
+       xorl    $FUTEX_PRIVATE_FLAG, reg ; \
+       andl    %gs:PRIVATE_FUTEX, reg ; \
+       orl     $FUTEX_WAIT | FUTEX_CLOCK_REALTIME, reg
 # define LOAD_FUTEX_WAKE(reg) \
        xorl    $FUTEX_PRIVATE_FLAG, reg ; \
        andl    %gs:PRIVATE_FUTEX, reg ; \
@@ -154,28 +160,81 @@ __lll_lock_wait:
        cfi_endproc
        .size   __lll_lock_wait,.-__lll_lock_wait
 
+       /*      %ecx: futex
+               %esi: flags
+               %edx: timeout
+               %eax: futex value
+       */
        .globl  __lll_timedlock_wait
        .type   __lll_timedlock_wait,@function
        .hidden __lll_timedlock_wait
        .align  16
 __lll_timedlock_wait:
        cfi_startproc
+       pushl   %ebp
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset(%ebp, 0)
+       pushl   %ebx
+       cfi_adjust_cfa_offset(4)
+       cfi_rel_offset(%ebx, 0)
+
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+#  ifdef PIC
+       LOAD_PIC_REG (bx)
+       cmpl    $0, __have_futex_clock_realtime@GOTOFF(%ebx)
+#  else
+       cmpl    $0, __have_futex_clock_realtime
+#  endif
+       je      .Lreltmo
+# endif
+
+       movl    %ecx, %ebx
+       movl    %esi, %ecx
+       movl    %edx, %esi
+       movl    $0xffffffff, %ebp
+       LOAD_FUTEX_WAIT_ABS (%ecx)
+
+       movl    $2, %edx
+       cmpl    %edx, %eax
+       jne     2f
+
+1:     movl    $SYS_futex, %eax
+       movl    $2, %edx
+       ENTER_KERNEL
+
+2:     xchgl   %edx, (%ebx)    /* NB:   lock is implied */
+
+       testl   %edx, %edx
+       jz      3f
+
+       cmpl    $-ETIMEDOUT, %eax
+       je      4f
+       cmpl    $-EINVAL, %eax
+       jne     1b
+4:     movl    %eax, %edx
+       negl    %edx
+
+3:     movl    %edx, %eax
+7:     popl    %ebx
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%ebx)
+       popl    %ebp
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%ebp)
+       ret
+
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+.Lreltmo:
        /* Check for a valid timeout value.  */
        cmpl    $1000000000, 4(%edx)
        jae     3f
 
-       pushl   %edi
-       cfi_adjust_cfa_offset(4)
        pushl   %esi
        cfi_adjust_cfa_offset(4)
-       pushl   %ebx
-       cfi_adjust_cfa_offset(4)
-       pushl   %ebp
+       cfi_rel_offset(%esi, 0)
+       pushl   %edi
        cfi_adjust_cfa_offset(4)
-       cfi_offset(%edi, -8)
-       cfi_offset(%esi, -12)
-       cfi_offset(%ebx, -16)
-       cfi_offset(%ebp, -20)
+       cfi_rel_offset(%edi, 0)
 
        /* Stack frame for the timespec and timeval structs.  */
        subl    $8, %esp
@@ -236,23 +295,24 @@ __lll_timedlock_wait:
 
 6:     addl    $8, %esp
        cfi_adjust_cfa_offset(-8)
-       popl    %ebp
-       cfi_adjust_cfa_offset(-4)
-       cfi_restore(%ebp)
-       popl    %ebx
+       popl    %edi
        cfi_adjust_cfa_offset(-4)
-       cfi_restore(%ebx)
+       cfi_restore(%edi)
        popl    %esi
        cfi_adjust_cfa_offset(-4)
        cfi_restore(%esi)
-       popl    %edi
+7:     popl    %ebx
        cfi_adjust_cfa_offset(-4)
-       cfi_restore(%edi)
+       cfi_restore(%ebx)
+       popl    %ebp
+       cfi_adjust_cfa_offset(-4)
+       cfi_restore(%ebp)
        movl    %edx, %eax
        ret
 
-3:     movl    $EINVAL, %eax
-       ret
+3:     movl    $EINVAL, %edx
+       jmp     7b
+# endif
        cfi_endproc
        .size   __lll_timedlock_wait,.-__lll_timedlock_wait
 #endif
index 993dd4be266f59c7269a2c51c38256861bca90d2..66e0e628fd261ca2dc502c8285a189a98a26426a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -55,6 +55,9 @@
 #define FUTEX_WAIT_BITSET      9
 #define FUTEX_WAKE_BITSET      10
 #define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
 
 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE  ((4 << 24) | 1)
 
index 9c4d16f453e6daafd42b4c3654944385b399ef6d..b419c9a5e1479a90fc3e63c52451362a8a826614 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
 
@@ -40,6 +40,9 @@
 #define FUTEX_WAIT_BITSET      9
 #define FUTEX_WAKE_BITSET      10
 #define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be
index 76a41bc191e270f64c5db7b935578abf6aaf6edf..66c02cbbddd5fbac6937eac7e12f1c807bf5a60d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
 
@@ -41,6 +41,9 @@
 #define FUTEX_WAIT_BITSET      9
 #define FUTEX_WAKE_BITSET      10
 #define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be
index 558d87d67c2a09125620e547ba22819f868456ed..c27332e1c725da35a9f026953b5ac95dfdac20ce 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>, 2003.
 
@@ -39,6 +39,9 @@
 #define FUTEX_WAIT_BITSET      9
 #define FUTEX_WAKE_BITSET      10
 #define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
 
 /* Values for 'private' parameter of locking macros.  Yes, the
    definition seems to be backwards.  But it is not.  The bit will be
index 4505e2cec6a3da4081ae7023c486d25516ca3e3f..8de9cf461a0f1221b998269e361a0bf2f528be12 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -31,6 +31,8 @@
        movl    $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
 # define LOAD_FUTEX_WAIT(reg) \
        xorl    $(FUTEX_WAIT | FUTEX_PRIVATE_FLAG), reg
+# define LOAD_FUTEX_WAIT_ABS(reg) \
+       xorl    $(FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME), reg
 # define LOAD_FUTEX_WAKE(reg) \
        xorl    $(FUTEX_WAKE | FUTEX_PRIVATE_FLAG), reg
 #else
        andl    %fs:PRIVATE_FUTEX, reg ; \
        orl     $FUTEX_WAIT, reg
 # endif
+# define LOAD_FUTEX_WAIT_ABS(reg) \
+       xorl    $FUTEX_PRIVATE_FLAG, reg ; \
+       andl    %fs:PRIVATE_FUTEX, reg ; \
+       orl     $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
 # define LOAD_FUTEX_WAKE(reg) \
        xorl    $FUTEX_PRIVATE_FLAG, reg ; \
        andl    %fs:PRIVATE_FUTEX, reg ; \
@@ -143,12 +149,61 @@ __lll_lock_wait:
        cfi_endproc
        .size   __lll_lock_wait,.-__lll_lock_wait
 
+       /*      %rdi: futex
+               %rsi: flags
+               %rdx: timeout
+               %eax: futex value
+       */
        .globl  __lll_timedlock_wait
        .type   __lll_timedlock_wait,@function
        .hidden __lll_timedlock_wait
        .align  16
 __lll_timedlock_wait:
        cfi_startproc
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+#  ifdef PIC
+       cmpl    $0, __have_futex_clock_realtime(%rip)
+#  else
+       cmpl    $0, __have_futex_clock_realtime
+#  endif
+       je      .Lreltmo
+# endif
+
+       pushq   %r9
+       cfi_adjust_cfa_offset(8)
+       cfi_rel_offset(%r9, 0)
+       movq    %rdx, %r10
+       movl    $0xffffffff, %r9d
+       LOAD_FUTEX_WAIT_ABS (%esi)
+
+       movl    $2, %edx
+       cmpl    %edx, %eax
+       jne     2f
+
+1:     movl    $SYS_futex, %eax
+       movl    $2, %edx
+       syscall
+
+2:     xchgl   %edx, (%rdi)    /* NB:   lock is implied */
+
+       testl   %edx, %edx
+       jz      3f
+
+       cmpl    $-ETIMEDOUT, %eax
+       je      4f
+       cmpl    $-EINVAL, %eax
+       jne     1b
+4:     movl    %eax, %edx
+       negl    %edx
+
+3:     movl    %edx, %eax
+       popq    %r9
+       cfi_adjust_cfa_offset(-8)
+       cfi_restore(%r9)
+       retq
+
+# ifndef __ASSUME_FUTEX_CLOCK_REALTIME
+.Lreltmo:
        /* Check for a valid timeout value.  */
        cmpq    $1000000000, 8(%rdx)
        jae     3f
@@ -253,6 +308,7 @@ __lll_timedlock_wait:
 
 3:     movl    $EINVAL, %eax
        retq
+# endif
        cfi_endproc
        .size   __lll_timedlock_wait,.-__lll_timedlock_wait
 #endif
index f76d599c48226e601a5a9ea4adde4411a49326fd..0b7e3bbaba962f15b9724068517e23a8f767b04d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006-2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
 #define FUTEX_WAIT             0
 #define FUTEX_WAKE             1
 #define FUTEX_CMP_REQUEUE      4
-#define FUTEX_WAKE_OP     5
+#define FUTEX_WAKE_OP          5
 #define FUTEX_LOCK_PI          6
 #define FUTEX_UNLOCK_PI                7
 #define FUTEX_TRYLOCK_PI       8
 #define FUTEX_WAIT_BITSET      9
 #define FUTEX_WAKE_BITSET      10
 #define FUTEX_PRIVATE_FLAG     128
+#define FUTEX_CLOCK_REALTIME   256
+
+#define FUTEX_BITSET_MATCH_ANY 0xffffffff
 
 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE  ((4 << 24) | 1)
 
index b42f9b6c1222d03d24470b136ca046dda8c36557..1c11a1d98d4d7183117ec50cb94891aea95b10fa 100644 (file)
@@ -1,5 +1,5 @@
-/* Turkish regular expression tests.
-   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* German regular expression tests.
+   Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
 
@@ -33,10 +33,10 @@ struct
   int flags, nmatch;
   regmatch_t rm[5];
 } tests[] = {
-  /* \xc3\x84  LATIN CAPITAL LETTER A WITH DIAERESIS
-     \xc3\x96  LATIN CAPITAL LETTER O WITH DIAERESIS
-     \xc3\xa4  LATIN SMALL LETTER A WITH DIAERESIS
-     \xc3\xb6  LATIN SMALL LETTER O WITH DIAERESIS  */
+  /* U+00C4    \xc3\x84        LATIN CAPITAL LETTER A WITH DIAERESIS
+     U+00D6    \xc3\x96        LATIN CAPITAL LETTER O WITH DIAERESIS
+     U+00E4    \xc3\xa4        LATIN SMALL LETTER A WITH DIAERESIS
+     U+00F6    \xc3\xb6        LATIN SMALL LETTER O WITH DIAERESIS  */
   { "\xc3\x84\xc3\x96*\xc3\xb6$", "aB\xc3\xa4\xc3\xb6\xc3\xb6\xc3\x96", REG_ICASE, 2,
     { { 2, 10 }, { -1, -1 } } },
   { "[\xc3\x84x]\xc3\x96*\xc3\xb6$", "aB\xc3\x84\xc3\xb6\xc3\xb6\xc3\x96", REG_ICASE, 2,
@@ -45,10 +45,22 @@ struct
     { { 2, 10 }, { -1, -1 } } },
   { "[^x]\xc3\x96*\xc3\xb6$", "aB\xc3\xa4\xc3\xb6\xc3\xb6\xc3\x96", REG_ICASE, 2,
     { { 2, 10 }, { -1, -1 } } },
+
+  /* Tests for bug 9697:
+     U+00DF    \xc3\x9f        LATIN SMALL LETTER SHARP S
+     U+02DA    \xcb\x9a        RING ABOVE
+     U+02E2    \xcb\xa2        MODIFIER LETTER SMALL S  */
+  { "[a-z]|[^a-z]", "\xcb\xa2", REG_EXTENDED, 2,
+    { { 0, 2 }, { -1, -1 } } },
+  { "[a-z]", "\xc3\x9f", REG_EXTENDED, 2,
+    { { 0, 2 }, { -1, -1 } } },
+  { "[^a-z]", "\xcb\x9a", REG_EXTENDED, 2,
+    { { 0, 2 }, { -1, -1 } } },
 };
 
-int
-main (void)
+
+static int
+do_test (void)
 {
   regex_t re;
   regmatch_t rm[5];
@@ -93,3 +105,6 @@ main (void)
 
   return ret;
 }
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 8ba7668e8be18f6de152344307e0abcec0c297f4..4843cfea339b117b44234e643181f5af8e1ad5a7 100644 (file)
@@ -1,5 +1,6 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+   Copyright (C) 2002,2003,2004,2005,2006,2007,2009
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -327,8 +328,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
                     && dfa->nodes[node].mb_partial)
                *p++ = dfa->nodes[node].opr.c;
              memset (&state, '\0', sizeof (state));
-             if (mbrtowc (&wc, (const char *) buf, p - buf,
-                          &state) == p - buf
+             if (__mbrtowc (&wc, (const char *) buf, p - buf,
+                            &state) == p - buf
                  && (__wcrtomb ((char *) buf, towlower (wc), &state)
                      != (size_t) -1))
                re_set_fastmap (fastmap, 0, buf[0]);
@@ -350,47 +351,67 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
 #ifdef RE_ENABLE_I18N
       else if (type == COMPLEX_BRACKET)
        {
-         int i;
          re_charset_t *cset = dfa->nodes[node].opr.mbcset;
-         if (cset->non_match || cset->ncoll_syms || cset->nequiv_classes
-             || cset->nranges || cset->nchar_classes)
-           {
+         int i;
+
 # ifdef _LIBC
-             if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0)
+         /* See if we have to try all bytes which start multiple collation
+            elements.
+            e.g. In da_DK, we want to catch 'a' since "aa" is a valid
+                 collation element, and don't catch 'b' since 'b' is
+                 the only collation element which starts from 'b' (and
+                 it is caught by SIMPLE_BRACKET).  */
+             if (_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES) != 0
+                 && (cset->ncoll_syms || cset->nranges))
                {
-                 /* In this case we want to catch the bytes which are
-                    the first byte of any collation elements.
-                    e.g. In da_DK, we want to catch 'a' since "aa"
-                         is a valid collation element, and don't catch
-                         'b' since 'b' is the only collation element
-                         which starts from 'b'.  */
                  const int32_t *table = (const int32_t *)
                    _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
                  for (i = 0; i < SBC_MAX; ++i)
                    if (table[i] < 0)
                      re_set_fastmap (fastmap, icase, i);
                }
-# else
-             if (dfa->mb_cur_max > 1)
-               for (i = 0; i < SBC_MAX; ++i)
-                 if (__btowc (i) == WEOF)
-                   re_set_fastmap (fastmap, icase, i);
-# endif /* not _LIBC */
-           }
-         for (i = 0; i < cset->nmbchars; ++i)
+# endif /* _LIBC */
+
+         /* See if we have to start the match at all multibyte characters,
+            i.e. where we would not find an invalid sequence.  This only
+            applies to multibyte character sets; for single byte character
+            sets, the SIMPLE_BRACKET again suffices.  */
+         if (dfa->mb_cur_max > 1
+             && (cset->nchar_classes || cset->non_match
+# ifdef _LIBC
+                 || cset->nequiv_classes
+# endif /* _LIBC */
+                ))
            {
-             char buf[256];
-             mbstate_t state;
-             memset (&state, '\0', sizeof (state));
-             if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
-               re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
-             if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+             unsigned char c = 0;
+             do
                {
-                 if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
-                     != (size_t) -1)
-                   re_set_fastmap (fastmap, 0, *(unsigned char *) buf);
+                 mbstate_t mbs;
+                 memset (&mbs, 0, sizeof (mbs));
+                 if (__mbrtowc (NULL, (char *) &c, 1, &mbs) == (size_t) -2)
+                   re_set_fastmap (fastmap, false, (int) c);
                }
+             while (++c != 0);
            }
+
+         else
+           {
+             /* ... Else catch all bytes which can start the mbchars.  */
+             for (i = 0; i < cset->nmbchars; ++i)
+               {
+                 char buf[256];
+                 mbstate_t state;
+                 memset (&state, '\0', sizeof (state));
+                 if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
+                   re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
+                 if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
+                   {
+                     if (__wcrtomb (buf, towlower (cset->mbchars[i]), &state)
+                         != (size_t) -1)
+                       re_set_fastmap (fastmap, false, *(unsigned char *) buf);
+                   }
+               }
+           }
        }
 #endif /* RE_ENABLE_I18N */
       else if (type == OP_PERIOD
index 01a432e80130803eae90f9c585cb89e93b6a0e32..c9da2b961cc34a183921b428150f41b8a6251b16 100644 (file)
@@ -229,7 +229,7 @@ build_wcs_buffer (re_string_t *pstr)
        }
       else
        p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
-      mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+      mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
       if (BE (mbclen == (size_t) -2, 0))
        {
          /* The buffer doesn't have enough space, finish to build.  */
@@ -299,9 +299,9 @@ build_wcs_upper_buffer (re_string_t *pstr)
 
          remain_len = end_idx - byte_idx;
          prev_st = pstr->cur_state;
-         mbclen = mbrtowc (&wc,
-                           ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
-                            + byte_idx), remain_len, &pstr->cur_state);
+         mbclen = __mbrtowc (&wc,
+                             ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
+                              + byte_idx), remain_len, &pstr->cur_state);
          if (BE (mbclen + 2 > 2, 1))
            {
              wchar_t wcu = wc;
@@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
          }
        else
          p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
-       mbclen = mbrtowc (&wc, p, remain_len, &pstr->cur_state);
+       mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
        if (BE (mbclen + 2 > 2, 1))
          {
            wchar_t wcu = wc;
@@ -491,8 +491,8 @@ re_string_skip_chars (re_string_t *pstr, int new_raw_idx, wint_t *last_wc)
       int remain_len;
       remain_len = pstr->len - rawbuf_idx;
       prev_st = pstr->cur_state;
-      mbclen = mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx,
-                       remain_len, &pstr->cur_state);
+      mbclen = __mbrtowc (&wc, (const char *) pstr->raw_mbs + rawbuf_idx,
+                         remain_len, &pstr->cur_state);
       if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0))
        {
          /* We treat these cases as a single byte character.  */
@@ -734,8 +734,8 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
                          /* XXX Don't use mbrtowc, we know which conversion
                             to use (UTF-8 -> UCS4).  */
                          memset (&cur_state, 0, sizeof (cur_state));
-                         mbclen = mbrtowc (&wc2, (const char *) p, mlen,
-                                           &cur_state);
+                         mbclen = __mbrtowc (&wc2, (const char *) p, mlen,
+                                             &cur_state);
                          if (raw + offset - p <= mbclen
                              && mbclen < (size_t) -2)
                            {
index 79266781b8348ed16ba7e559adbaf34cc964affb..65a99058605d482ff143dda23f262f3a81f8f0a4 100644 (file)
 # define __wctype wctype
 # define __iswctype iswctype
 # define __btowc btowc
+# define __mbrtowc mbrtowc
 # define __mempcpy mempcpy
 # define __wcrtomb wcrtomb
 # define __regfree regfree
index 135efe7441fd8edcd57e00b7dbfac6740d76eb8d..7bf0c08a78cb2189a6c07b04ce7cc6bf27cc41dc 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -1004,6 +1004,11 @@ prune_impossible_nodes (mctx)
       re_node_set_free (&sctx.limits);
       if (BE (ret != REG_NOERROR, 0))
        goto free_return;
+      if (sifted_states[0] == NULL)
+       {
+         ret = REG_NOMATCH;
+         goto free_return;
+       }
     }
   re_free (mctx->state_log);
   mctx->state_log = sifted_states;
index b84a270cdaa3b0db6c3d0e3f9adbe5e790c0a455..3ad46e2a61ec4f007a4539ac847b7ff2ae0adb16 100644 (file)
@@ -536,3 +536,7 @@ a.*\b       &       abT     ab
 \B     &       aSbTc
 \B     &       SaT     @SaT
 \B     &       aSTSb   @TSb
+
+o$($|.)        -       oN
+o$($|.)        -       op
+o$($|.)        -       o       o
index b8e513a929b82f166175b14b6bd4f3d9ab157475..a9462ae97ac1fdc10ff8526d81bd58c2f6013dc3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2004, 2007, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -376,6 +376,19 @@ _nss_dns_gethostbyaddr2_r (const void *addr, socklen_t len, int af,
   int n, status;
   int olderr = errno;
 
+ uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct host_data);
+ buffer += pad;
+ buflen = buflen > pad ? buflen - pad : 0;
+
+ if (__builtin_expect (buflen < sizeof (struct host_data), 0))
+   {
+     *errnop = ERANGE;
+     *h_errnop = NETDB_INTERNAL;
+     return NSS_STATUS_TRYAGAIN;
+   }
+
+ host_data = (struct host_data *) buffer;
+
   if (__res_maybe_init (&_res, 0) == -1)
     return NSS_STATUS_UNAVAIL;
 
index 8677515cd9a5eebec66d6417c5ee985b0822886b..95d7ba3800d500eebb7fdd45409f273b1855da5b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1993,94,95,96,97,98,99,2000,2001,2002, 2003, 2004
+# Copyright (C) 1993,94,95,96,97,98,99,2000,2001,2002,2003,2004,2009
 #      Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -206,4 +206,9 @@ ifeq ($(subdir),sunrpc)
 sysdep_headers += nfs/nfs.h
 endif
 
+ifeq ($(subdir),socket)
+sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h net/if_ppp.h \
+                 net/route.h
+endif
+
 endif  # in-Makerules
index 95d64ed77faf16463280004bf400cee41767f36d..cb3acf16228eadf9bde16e7b88a596af5b7eda7e 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Linux version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2008, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -158,10 +158,11 @@ enum __rusage_who
 #define RUSAGE_SELF RUSAGE_SELF
 
   /* All of its terminated child processes.  */
-  RUSAGE_CHILDREN = -1,
+  RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
 
 #ifdef __USE_GNU
+  ,
   /* The calling thread.  */
   RUSAGE_THREAD = 1
 # define RUSAGE_THREAD RUSAGE_THREAD
index 89d5b12043906666d854cf8e289307ebd901ee62..77e6bad1051853e2ecfa236f193ac03a64dc7f58 100644 (file)
        arg 3           %edx         call-clobbered
        arg 4           %esi         call-saved
        arg 5           %edi         call-saved
+       arg 6           %ebp         call-saved
 
    The stack layout upon entering the function is:
 
+       24(%esp)        Arg# 6
        20(%esp)        Arg# 5
        16(%esp)        Arg# 4
        12(%esp)        Arg# 3
          (%esp)        Return address
 
    (Of course a function with say 3 arguments does not have entries for
-   arguments 4 and 5.)
+   arguments 4, 5, and 6.)
 
    The following code tries hard to be optimal.  A general assumption
    (which is true according to the data books I have) is that
index 42b1c105a2160ca2962c2c4058b34e38898a8999..29afe277110ae6139a01f64356b3a1f6a8a07444 100644 (file)
@@ -1,6 +1,6 @@
 /* Set flags signalling availability of kernel features based on given
    kernel version number.
-   Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1999-2006, 2007, 2008, 2009 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
    x86-64, PPC, IA-64, and SPARC in 2.6.27.  */
 #if __LINUX_KERNEL_VERSION >= 0x02061b \
     && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
-       || defined __ia64__ || defined __sparc__ || __s390__)
+       || defined __ia64__ || defined __sparc__ || defined __s390__)
 # define __ASSUME_SOCK_CLOEXEC 1
 # define __ASSUME_IN_NONBLOCK  1
 # define __ASSUME_PIPE2                1
 /* Support for the accept4 syscall was added in 2.6.28.  */
 #if __LINUX_KERNEL_VERSION >= 0x02061c \
     && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
-       || defined __ia64__ || defined __sparc__ || __s390__)
+       || defined __ia64__ || defined __sparc__ || defined __s390__)
 # define __ASSUME_ACCEPT4      1
 #endif
+
+/* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061d
+# define __ASSUME_FUTEX_CLOCK_REALTIME 1
+#endif
index 5c5381871b677ec26e824e5b1eb0731ebb24fd57..72eae688dbe3219557a2f289d509fafd2322e310 100644 (file)
@@ -6,3 +6,7 @@ endif
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
+
+ifeq ($(subdir),elf)
+sysdep_routines += dl-vdso
+endif
diff --git a/sysdeps/unix/sysv/linux/s390/Versions b/sysdeps/unix/sysv/linux/s390/Versions
new file mode 100644 (file)
index 0000000..627ff53
--- /dev/null
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_PRIVATE {
+    __vdso_clock_gettime;
+    __vdso_clock_getres;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/s390/bits/libc-vdso.h
new file mode 100644 (file)
index 0000000..f289f9a
--- /dev/null
@@ -0,0 +1,35 @@
+/* Resolve function pointers to VDSO functions.
+   Copyright (C) 2008 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.  */
+
+
+#ifndef _LIBC_VDSO_H
+#define _LIBC_VDSO_H
+
+#ifdef SHARED
+
+extern long int (*__vdso_gettimeofday) (struct timeval *, void *)
+  attribute_hidden;
+
+extern long int (*__vdso_clock_gettime) (clockid_t, struct timespec *);
+
+extern long int (*__vdso_clock_getres) (clockid_t, struct timespec *);
+
+#endif
+
+#endif /* _LIBC_VDSO_H */
diff --git a/sysdeps/unix/sysv/linux/s390/gettimeofday.c b/sysdeps/unix/sysv/linux/s390/gettimeofday.c
new file mode 100644 (file)
index 0000000..1914c3b
--- /dev/null
@@ -0,0 +1,42 @@
+/* Copyright (C) 2008 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.  */
+
+#include <sysdep.h>
+#include <bp-checks.h>
+#include <stddef.h>
+#include <sys/time.h>
+#include <time.h>
+#include <hp-timing.h>
+
+#undef __gettimeofday
+#include <bits/libc-vdso.h>
+
+/* Get the current time of day and timezone information,
+   putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
+   Returns 0 on success, -1 on errors.  */
+
+int
+__gettimeofday (tv, tz)
+     struct timeval *tv;
+     struct timezone *tz;
+{
+  return INLINE_VSYSCALL (gettimeofday, 2, CHECK_1 (tv), CHECK_1 (tz));
+}
+
+INTDEF (__gettimeofday)
+weak_alias (__gettimeofday, gettimeofday)
diff --git a/sysdeps/unix/sysv/linux/s390/init-first.c b/sysdeps/unix/sysv/linux/s390/init-first.c
new file mode 100644 (file)
index 0000000..7091aac
--- /dev/null
@@ -0,0 +1,50 @@
+/* Copyright (C) 2008 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.  */
+
+#ifdef SHARED
+# include <dl-vdso.h>
+# undef __gettimeofday
+# undef __clock_gettime
+# undef __clock_getres
+# include <bits/libc-vdso.h>
+
+long int (*__vdso_gettimeofday) (struct timeval *, void *) attribute_hidden;
+
+long int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
+  __attribute__ ((nocommon));
+strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
+
+long int (*__vdso_clock_getres) (clockid_t, struct timespec *)
+  __attribute__ ((nocommon));
+strong_alias (__vdso_clock_getres, __GI___vdso_clock_getres attribute_hidden)
+
+
+static inline void
+_libc_vdso_platform_setup (void)
+{
+  PREPARE_VERSION (linux2629, "LINUX_2.6.29", 123718585);
+
+  __vdso_gettimeofday = _dl_vdso_vsym ("__kernel_gettimeofday", &linux2629);
+  __vdso_clock_gettime = _dl_vdso_vsym ("__kernel_clock_gettime", &linux2629);
+  __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2629);
+}
+
+# define VDSO_SETUP _libc_vdso_platform_setup
+#endif
+
+#include "../init-first.c"
index b86072bd30577cebd5491f3239fc372e25fdbe28..5bfdc44f482a026e68ab85cd14422f431d65a5a6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
+/* Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008
    Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 #include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO.  */
 #include <tls.h>
 
+/* Define __set_errno() for INLINE_SYSCALL macro below.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
        /usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
 #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
 #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
 
+#define CLOBBER_0 , "3", "4", "5"
+#define CLOBBER_1 , "3", "4", "5"
+#define CLOBBER_2 , "4", "5"
+#define CLOBBER_3 , "5"
+#define CLOBBER_4
+#define CLOBBER_5
+#define CLOBBER_6
+
+/* List of system calls which are supported as vsyscalls.  */
+#define HAVE_CLOCK_GETRES_VSYSCALL     1
+#define HAVE_CLOCK_GETTIME_VSYSCALL    1
+
+/* This version is for kernels that implement system calls that
+   behave like function calls as far as register saving.
+   It falls back to the syscall in the case that the vDSO doesn't
+   exist or fails for ENOSYS */
+#ifdef SHARED
+# define INLINE_VSYSCALL(name, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    __label__ iserr;                                                         \
+    long int _ret;                                                           \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, , nr, ##args);           \
+       if (!INTERNAL_SYSCALL_ERROR_P (_ret, ))                               \
+         goto out;                                                           \
+       if (INTERNAL_SYSCALL_ERRNO (_ret, ) != ENOSYS)                        \
+         goto iserr;                                                         \
+      }                                                                              \
+                                                                             \
+    _ret = INTERNAL_SYSCALL (name, , nr, ##args);                            \
+    if (INTERNAL_SYSCALL_ERROR_P (_ret, ))                                   \
+      {                                                                              \
+      iserr:                                                                 \
+        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));                       \
+        _ret = -1L;                                                          \
+      }                                                                              \
+  out:                                                                       \
+    (int) _ret;                                                                      \
+  })
+#else
+# define INLINE_VSYSCALL(name, nr, args...) \
+  INLINE_SYSCALL (name, nr, ##args)
+#endif
+
+#ifdef SHARED
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    long int _ret;                                                           \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);        \
+       if (!INTERNAL_SYSCALL_ERROR_P (_ret, err)                             \
+           || INTERNAL_SYSCALL_ERRNO (_ret, err) != ENOSYS)                  \
+         goto out;                                                           \
+      }                                                                              \
+    _ret = INTERNAL_SYSCALL (name, err, nr, ##args);                         \
+  out:                                                                       \
+    _ret;                                                                    \
+  })
+#else
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL (name, err, nr, ##args)
+#endif
+
+/* This version is for internal uses when there is no desire
+   to set errno */
+#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)        \
+  ({                                                                         \
+    long int _ret = ENOSYS;                                                  \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);         \
+    else                                                                     \
+      err = 1 << 28;                                                         \
+    _ret;                                                                    \
+  })
+
+#define INTERNAL_VSYSCALL_NCS(fn, err, nr, args...)                          \
+  ({                                                                         \
+    DECLARGS_##nr(args)                                                              \
+    register long _ret asm("2");                                                     \
+    asm volatile (                                                           \
+    "lr 11,14\n\t"                                                           \
+    "basr 14,%1\n\t"                                                         \
+    "lr 14,11\n\t"                                                           \
+    : "=d" (_ret)                                                            \
+    : "d" (fn) ASMFMT_##nr                                                   \
+    : "cc", "memory", "0", "1", "11" CLOBBER_##nr);                          \
+    _ret; })
 
 /* Pointer mangling support.  */
 #if defined NOT_IN_libc && defined IS_IN_rtld
index 9ddec8e04179783928ad6526844ecd2452f816d2..6491a3b7b6278fa8f48bc8c7f780bb2de1400bcc 100644 (file)
@@ -1,5 +1,5 @@
 /* Assembler macros for 64 bit S/390.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008
    Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 #include <dl-sysdep.h> /* For RTLD_PRIVATE_ERRNO.  */
 #include <tls.h>
 
+/* Define __set_errno() for INLINE_SYSCALL macro below.  */
+#ifndef __ASSEMBLER__
+#include <errno.h>
+#endif
+
 /* For Linux we can use the system call table in the header file
        /usr/include/asm/unistd.h
    of the kernel.  But these symbols do not follow the SYS_* syntax
 #define ASMFMT_5 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6)
 #define ASMFMT_6 , "0" (gpr2), "d" (gpr3), "d" (gpr4), "d" (gpr5), "d" (gpr6), "d" (gpr7)
 
+#define CLOBBER_0 , "3", "4", "5"
+#define CLOBBER_1 , "3", "4", "5"
+#define CLOBBER_2 , "4", "5"
+#define CLOBBER_3 , "5"
+#define CLOBBER_4
+#define CLOBBER_5
+#define CLOBBER_6
+
+/* List of system calls which are supported as vsyscalls.  */
+#define HAVE_CLOCK_GETRES_VSYSCALL     1
+#define HAVE_CLOCK_GETTIME_VSYSCALL    1
+
+/* This version is for kernels that implement system calls that
+   behave like function calls as far as register saving.
+   It falls back to the syscall in the case that the vDSO doesn't
+   exist or fails for ENOSYS */
+#ifdef SHARED
+# define INLINE_VSYSCALL(name, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    __label__ iserr;                                                         \
+    long int _ret;                                                           \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, , nr, ##args);           \
+       if (!INTERNAL_SYSCALL_ERROR_P (_ret, ))                               \
+         goto out;                                                           \
+       if (INTERNAL_SYSCALL_ERRNO (_ret, ) != ENOSYS)                        \
+         goto iserr;                                                         \
+      }                                                                              \
+                                                                             \
+    _ret = INTERNAL_SYSCALL (name, , nr, ##args);                            \
+    if (INTERNAL_SYSCALL_ERROR_P (_ret, ))                                   \
+      {                                                                              \
+      iserr:                                                                 \
+        __set_errno (INTERNAL_SYSCALL_ERRNO (_ret, ));                       \
+        _ret = -1L;                                                          \
+      }                                                                              \
+  out:                                                                       \
+    (int) _ret;                                                                      \
+  })
+#else
+# define INLINE_VSYSCALL(name, nr, args...) \
+  INLINE_SYSCALL (name, nr, ##args)
+#endif
+
+#ifdef SHARED
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  ({                                                                         \
+    __label__ out;                                                           \
+    long int _ret;                                                           \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      {                                                                              \
+       _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);        \
+       if (!INTERNAL_SYSCALL_ERROR_P (_ret, err)                             \
+           || INTERNAL_SYSCALL_ERRNO (_ret, err) != ENOSYS)                  \
+         goto out;                                                           \
+      }                                                                              \
+    _ret = INTERNAL_SYSCALL (name, err, nr, ##args);                         \
+  out:                                                                       \
+    _ret;                                                                    \
+  })
+#else
+# define INTERNAL_VSYSCALL(name, err, nr, args...) \
+  INTERNAL_SYSCALL (name, err, nr, ##args)
+#endif
+
+/* This version is for internal uses when there is no desire
+   to set errno */
+#define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, nr, args...)        \
+  ({                                                                         \
+    long int _ret = ENOSYS;                                                  \
+                                                                             \
+    if (__vdso_##name != NULL)                                               \
+      _ret = INTERNAL_VSYSCALL_NCS (__vdso_##name, err, nr, ##args);         \
+    else                                                                     \
+      err = 1 << 28;                                                         \
+    _ret;                                                                    \
+  })
+
+#define INTERNAL_VSYSCALL_NCS(fn, err, nr, args...)                          \
+  ({                                                                         \
+    DECLARGS_##nr(args)                                                              \
+    register long _ret asm("2");                                             \
+    asm volatile (                                                           \
+    "lgr 11,14\n\t"                                                          \
+    "basr 14,%1\n\t"                                                         \
+    "lgr 14,11\n\t"                                                          \
+    : "=d" (_ret)                                                            \
+    : "a" (fn) ASMFMT_##nr                                                   \
+    : "cc", "memory", "0", "1", "11" CLOBBER_##nr);                          \
+    _ret; })
+
 /* Pointer mangling support.  */
 #if defined NOT_IN_libc && defined IS_IN_rtld
 /* We cannot use the thread descriptor because in ld.so we use setjmp
index 22c087da46543a85e7fd60fc828fd4460103be00..6e4fc97e5b54f9d6ccb0589b2c1f8ecfe83a1392 100644 (file)
@@ -1,5 +1,5 @@
 /* Bit values & structures for resource limits.  Linux/SPARC version.
-   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005
+   Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2004, 2005, 2008, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -174,10 +174,11 @@ enum __rusage_who
 #define RUSAGE_SELF RUSAGE_SELF
 
   /* All of its terminated child processes.  */
-  RUSAGE_CHILDREN = -1,
+  RUSAGE_CHILDREN = -1
 #define RUSAGE_CHILDREN RUSAGE_CHILDREN
 
 #ifdef __USE_GNU
+  ,
   /* The calling thread.  */
   RUSAGE_THREAD = 1
 # define RUSAGE_THREAD RUSAGE_THREAD