]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20081112T2008 cvs/fedora-glibc-2_8_90-17
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Nov 2008 20:29:35 +0000 (20:29 +0000)
committerJakub Jelinek <jakub@redhat.com>
Wed, 12 Nov 2008 20:29:35 +0000 (20:29 +0000)
37 files changed:
ChangeLog
NEWS
bits/libc-tsd.h
configure
configure.in
ctype/ctype-info.c
fedora/branch.mk
fedora/glibc.spec.in
include/ctype.h
include/rpc/rpc.h
include/stdio.h
locale/global-locale.c
locale/lc-ctype.c
locale/localeinfo.h
locale/uselocale.c
malloc/malloc.c
math/tgmath.h
misc/hsearch_r.c
nptl/ChangeLog
nptl/Makefile
nptl/pthread_cond_init.c
nptl/pthread_condattr_setclock.c
nptl/pthread_mutex_lock.c
nptl/pthread_mutex_timedlock.c
nptl/pthread_mutex_trylock.c
nptl/pthread_mutex_unlock.c
nptl/sysdeps/pthread/gai_misc.h
nptl/sysdeps/pthread/malloc-machine.h
nptl/tst-cond23.c [new file with mode: 0644]
resolv/nss_dns/dns-host.c
sunrpc/rpc_main.c
sunrpc/rpc_thread.c
sysdeps/mach/hurd/bits/libc-tsd.h
sysdeps/mach/hurd/malloc-machine.h
sysdeps/s390/bits/atomic.h
sysdeps/s390/s390-64/dl-trampoline.S
sysdeps/x86_64/configure [new file with mode: 0644]

index 1b93c676be2e99296b2ca228da4b4ec838ebb599..f9577c9140a8a90cd4e3a76308b2c3aa4979dc22 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,75 @@
+2008-11-11  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #7009]
+       * resolv/nss_dns/dns-host.c (gaih_getanswer_slice): Don't abort for
+       unknown request types for now.
+
+2008-11-11  Roland McGrath  <roland@redhat.com>
+
+       * sysdeps/x86_64/configure: New file.
+
+       * configure.in: Add AC_SUBST(libc_cv_cpp_asm_debuginfo).
+       * configure: Regenerated.
+
+2008-11-03  Martin Schwidefsky  <schwidefsky@de.ibm.com>
+
+       * sysdeps/s390/s390-64/dl-trampoline.S (_dl_runtime_profile): Use the
+       correct instruction to remove the stack frame.
+
+2008-11-03  Michael Matz  <matz@suse.de>
+
+       * sysdeps/s390/bits/atomic.h (__arch_compare_and_exchange_val_32_acq,
+       __arch_compare_and_exchange_val_64_acq): Add "memory" clobber.
+
+2008-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * include/stdio.h (__builtin_fwrite, __builtin_fwrite_unlocked):
+       Remove.
+
+       * bits/libc-tsd.h (__libc_tsd_define, __libc_tsd_address,
+       __libc_tsd_get, __libc_tsd_set): Add TYPE argument, use it as the type
+       of the thread variable instead of void *.
+       * sysdeps/mach/hurd/bits/libc-tsd.h (__libc_tsd_define,
+       __libc_tsd_address, __libc_tsd_get, __libc_tsd_set): Likewise.
+       * include/ctype.h (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
+       __libc_tsd_define arguments.
+       (__ctype_b_loc, __ctype_toupper_loc, __ctype_tolower_loc): Adjust
+       __libc_tsd_address arguments.  Remove union hack.
+       * include/rpc/rpc.h (RPC_VARS): Adjust __libc_tsd_define arguments.
+       * sunrpc/rpc_thread.c (RPC_VARS): Likewise.
+       (__rpc_thread_destroy, rpc_thread_multi, __rpc_thread_variables):
+       Adjust __libc_tsd_{set,get} arguments.
+       * ctype/ctype-info.c (CTYPE_B, CTYPE_TOUPPER, CTYPE_TOLOWER): Adjust
+       __libc_tsd_define arguments.
+       * locale/uselocale.c (__uselocale): Adjust __libc_tsd_{set,get}
+       arguments.
+       * locale/lc-ctype.c (_nl_postload_ctype): Likewise.
+       * locale/global-locale.c (__libc_tsd_LOCALE): Adjust type.
+       (LOCALE): Adjust __libc_tsd_define arguments.
+       * locale/localeinfo.h (_NL_CURRENT_LOCALE): Adjust __libc_tsd_get
+       arguments.
+       (LOCALE): Adjust __libc_tsd_define arguments.
+       * sysdeps/mach/hurd/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
+       arguments.
+       (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
+       arguments.
+
+2008-11-02  Ulrich Drepper  <drepper@redhat.com>
+
+       * malloc/malloc.c (public_rEALLOc): When new arena is used, copy
+       really all bytes.  Patch by Denys Vlasenko <dvlasenk@redhat.com>.
+
+2008-11-01  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #6966]
+       * misc/hsearch_r.c (hsearch_r): Fix secondary hash function.
+
+2008-10-24  Joseph Myers  <joseph@codesourcery.com>
+           Ulrich Drepper  <drepper@redhat.com>
+
+       * math/tgmath.h (__floating_type): Use __builtin_classify_type in
+       definition for GCC 3.1 and later.
+
 2008-10-31  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/dl-tls.c (__tls_get_addr): After calling _dl_update_slotinfo
diff --git a/NEWS b/NEWS
index b17f053c00a6c0fbfa6e494915feb83f108de08b..08c9e211e2c52702830a71c61598f8a27029e169 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2008-9-29
+GNU C Library NEWS -- history of user-visible changes.  2008-10-31
 Copyright (C) 1992-2007, 2008 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -36,7 +36,8 @@ Version 2.9
 * Many functions, exported and internal, now atomically set the close-on-exec
   flag when run on a sufficiently new kernel.  Implemented by Ulrich Drepper.
 
-* Sorting rules for some Indian languages (Kannada, Gurumukhi, Telugu)
+* Sorting rules for some Indian languages (Kannada, Gurumukhi, Telugu,
+  Sinhala)
   Implemented by Pravin Satpute.
 
 * New locales: sd_IN, sd_IN@devanagari, ks_IN@devanagari, ht_HT, en_AG, nl_AW.
index d39382952ad1ccadc81525533cba9611b47f4c1e..1a24b701b9fc95f6b1b4bb2be063757eee39cf26 100644 (file)
@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  Stub or TLS version.
-   Copyright (C) 1998,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1998,2001,2002,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
 /* This file defines the following macros for accessing a small fixed
    set of thread-specific `void *' data used only internally by libc.
 
-   __libc_tsd_define(CLASS, KEY)       -- Define or declare a `void *' datum
+   __libc_tsd_define(CLASS, TYPE, KEY) -- Define or declare a datum with TYPE
                                           for KEY.  CLASS can be `static' for
                                           keys used in only one source file,
                                           empty for global definitions, or
                                           `extern' for global declarations.
-   __libc_tsd_address(KEY)             -- Return the `void **' pointing to
+   __libc_tsd_address(TYPE, KEY)       -- Return the `TYPE *' pointing to
                                           the current thread's datum for KEY.
-   __libc_tsd_get(KEY)                 -- Return the `void *' datum for KEY.
-   __libc_tsd_set(KEY, VALUE)          -- Set the datum for KEY to VALUE.
+   __libc_tsd_get(TYPE, KEY)           -- Return the `TYPE' datum for KEY.
+   __libc_tsd_set(TYPE, KEY, VALUE)    -- Set the datum for KEY to VALUE.
 
    The set of available KEY's will usually be provided as an enum,
    and contains (at least):
    translate directly into variables by macro magic.  */
 
 #if USE___THREAD
-# define __libc_tsd_define(CLASS, KEY) \
-  CLASS __thread void *__libc_tsd_##KEY attribute_tls_model_ie;
+# define __libc_tsd_define(CLASS, TYPE, KEY)   \
+  CLASS __thread TYPE __libc_tsd_##KEY attribute_tls_model_ie;
 
-# define __libc_tsd_address(KEY)       (&__libc_tsd_##KEY)
-# define __libc_tsd_get(KEY)           (__libc_tsd_##KEY)
-# define __libc_tsd_set(KEY, VALUE)    (__libc_tsd_##KEY = (VALUE))
+# define __libc_tsd_address(TYPE, KEY)         (&__libc_tsd_##KEY)
+# define __libc_tsd_get(TYPE, KEY)             (__libc_tsd_##KEY)
+# define __libc_tsd_set(TYPE, KEY, VALUE)      (__libc_tsd_##KEY = (VALUE))
 #else
-# define __libc_tsd_define(CLASS, KEY) CLASS void *__libc_tsd_##KEY##_data;
+# define __libc_tsd_define(CLASS, TYPE, KEY)   \
+  CLASS TYPE __libc_tsd_##KEY##_data;
 
-# define __libc_tsd_address(KEY)       (&__libc_tsd_##KEY##_data)
-# define __libc_tsd_get(KEY)           (__libc_tsd_##KEY##_data)
-# define __libc_tsd_set(KEY, VALUE)    (__libc_tsd_##KEY##_data = (VALUE))
+# define __libc_tsd_address(TYPE, KEY)         (&__libc_tsd_##KEY##_data)
+# define __libc_tsd_get(TYPE, KEY)             (__libc_tsd_##KEY##_data)
+# define __libc_tsd_set(TYPE, KEY, VALUE)      (__libc_tsd_##KEY##_data = (VALUE))
 #endif
 
 #endif /* bits/libc-tsd.h */
index 73f199689e80491877cedf989b9a3cef6ac20fd0..a2a792c93fb03d2dade12f8ad6d84c7f4af34f3e 100755 (executable)
--- a/configure
+++ b/configure
@@ -748,6 +748,7 @@ libc_cv_localedir
 libc_cv_sysconfdir
 libc_cv_rootsbindir
 libc_cv_forced_unwind
+libc_cv_cpp_asm_debuginfo
 use_ldconfig
 ldd_rewrite_script
 elf
@@ -8445,6 +8446,8 @@ fi
 
 
 
+
+
 if test $elf = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_ELF 1
@@ -9311,6 +9314,7 @@ libc_cv_localedir!$libc_cv_localedir$ac_delim
 libc_cv_sysconfdir!$libc_cv_sysconfdir$ac_delim
 libc_cv_rootsbindir!$libc_cv_rootsbindir$ac_delim
 libc_cv_forced_unwind!$libc_cv_forced_unwind$ac_delim
+libc_cv_cpp_asm_debuginfo!$libc_cv_cpp_asm_debuginfo$ac_delim
 use_ldconfig!$use_ldconfig$ac_delim
 ldd_rewrite_script!$ldd_rewrite_script$ac_delim
 elf!$elf$ac_delim
@@ -9331,7 +9335,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 53; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
index 1651d38c10570436c73b642c7b764172cfb9d7fc..4a2b54605ee1c71800bbd249a05ffcc89224c7fe 100644 (file)
@@ -2181,6 +2181,9 @@ AC_SUBST(libc_cv_sysconfdir)
 AC_SUBST(libc_cv_rootsbindir)
 AC_SUBST(libc_cv_forced_unwind)
 
+dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
+AC_SUBST(libc_cv_cpp_asm_debuginfo)
+
 AC_SUBST(use_ldconfig)
 AC_SUBST(ldd_rewrite_script)
 
index 35f2fb540f7f671d2a0be162c7b7e10cbbb02ec7..03b67d179f802ab4b0278a5c7a23814238232b8b 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,95,96,97,99,2000,02 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,95,96,97,99,2000, 2002, 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
@@ -20,9 +21,9 @@
 #include <ctype.h>
 #include <locale/localeinfo.h>
 
-__libc_tsd_define (, CTYPE_B)
-__libc_tsd_define (, CTYPE_TOLOWER)
-__libc_tsd_define (, CTYPE_TOUPPER)
+__libc_tsd_define (, const uint16_t *, CTYPE_B)
+__libc_tsd_define (, const int32_t *, CTYPE_TOLOWER)
+__libc_tsd_define (, const int32_t *, CTYPE_TOUPPER)
 
 
 #include <shlib-compat.h>
index b4292956c9f049542fa419f73f55c3afc45f4ea5..a7dac68fcfa749d0ace558e5484823ad9dace44c 100644 (file)
@@ -3,5 +3,5 @@ glibc-branch := fedora
 glibc-base := HEAD
 DIST_BRANCH := devel
 COLLECTION := dist-f8
-fedora-sync-date := 2008-10-31 21:02 UTC
-fedora-sync-tag := fedora-glibc-20081031T2102
+fedora-sync-date := 2008-11-12 20:08 UTC
+fedora-sync-tag := fedora-glibc-20081112T2008
index acf25782173202896616f78a4a13be4d4e295c82..08e3f9e5976598845c2758ae595058ec40d68066 100644 (file)
@@ -19,7 +19,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: @glibcversion@
-Release: 16
+Release: 17
 # 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,11 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Wed Nov 12 2008 Jakub Jelinek <jakub@redhat.com> 2.8.90-17
+- update from trunk
+  - don't abort on broken DNS replies (#469299, BZ#7009)
+  - misc fixes (BZ#6966, BZ#7008, BZ#6955, BZ#6843)
+
 * Fri Oct 31 2008 Jakub Jelinek <jakub@redhat.com> 2.8.90-16
 - update from trunk
   - further resolver fixes
index ae38b1bf234e8ddf72aeb339b877199ff3dcba21..f4b782e13617428c63565be3a7d20f36934fb353 100644 (file)
@@ -18,50 +18,35 @@ extern int __isctype (int __c, int __mask);
 #   define CTYPE_EXTERN_INLINE extern inline
 #  endif
 
-__libc_tsd_define (extern, CTYPE_B)
-__libc_tsd_define (extern, CTYPE_TOUPPER)
-__libc_tsd_define (extern, CTYPE_TOLOWER)
+__libc_tsd_define (extern, const uint16_t *, CTYPE_B)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOUPPER)
+__libc_tsd_define (extern, const int32_t *, CTYPE_TOLOWER)
 
 CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
 __ctype_b_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const uint16_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_B);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
-  return u.tablep;
+  const uint16_t **tablep = __libc_tsd_address (const uint16_t *, CTYPE_B);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
+  return tablep;
 }
 
 CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
 __ctype_toupper_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const int32_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_TOUPPER);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
-  return u.tablep;
+  const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOUPPER);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
+  return tablep;
 }
 
 CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
 __ctype_tolower_loc (void)
 {
-  union
-    {
-      void **ptr;
-      const int32_t **tablep;
-    } u;
-  u.ptr = __libc_tsd_address (CTYPE_TOLOWER);
-  if (__builtin_expect (*u.tablep == NULL, 0))
-    *u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
-  return u.tablep;
+  const int32_t **tablep = __libc_tsd_address (const int32_t *, CTYPE_TOLOWER);
+  if (__builtin_expect (*tablep == NULL, 0))
+    *tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
+  return tablep;
 }
 
 # endif        /* Not NOT_IN_libc.  */
index e5b1685f5412faf9facd80604e50dd74847e8e77..d2f30131141c7abb50a6ea436dd0f4deff81b902 100644 (file)
@@ -45,7 +45,7 @@ extern void __rpc_thread_key_cleanup (void);
 
 extern void __rpc_thread_destroy (void);
 
-__libc_tsd_define (extern, RPC_VARS)
+__libc_tsd_define (extern, struct rpc_thread_variables *, RPC_VARS)
 
 #define RPC_THREAD_VARIABLE(x) (__rpc_thread_variables()->x)
 
index 54f2507261fa07d2680455534944c4893206d5d7..d82728a845f8933c1b69e4270a2caacbe34b9e86 100644 (file)
@@ -160,17 +160,6 @@ libc_hidden_proto (__vfprintf_chk)
 libc_hidden_proto (__vasprintf_chk)
 libc_hidden_proto (__vdprintf_chk)
 libc_hidden_proto (__obstack_vprintf_chk)
-
-#  if !defined NOT_IN_libc && defined SHARED && defined DO_VERSIONING \
-  && !defined NO_HIDDEN
-/* Special gcc builtins.  */
-extern size_t __builtin_fwrite (const void *, size_t, size_t, void *)
-     __asm ("__GI_fwrite");
-extern size_t __builtin_fwrite_unlocked (const void *, size_t, size_t, void *)
-     __asm ("__GI_fwrite_unlocked");
-
-#  endif
-
 # endif
 
 #endif
index 2280f68df47ad3b3c91939702e2c3e9cc229b798..771742e1be2e49dfec6f8d32fadc3e55b5fffee0 100644 (file)
@@ -1,5 +1,5 @@
 /* Locale object representing the global locale controlled by setlocale.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006, 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
@@ -62,9 +62,9 @@ struct __locale_struct _nl_global_locale attribute_hidden =
 #include <tls.h>
 #if HAVE___THREAD
 /* The tsd macros don't permit an initializer.  */
-__thread void *__libc_tsd_LOCALE = &_nl_global_locale;
+__thread __locale_t __libc_tsd_LOCALE = &_nl_global_locale;
 #else
-__libc_tsd_define (, LOCALE)
+__libc_tsd_define (, __locale_t, LOCALE)
 /* This is a bad kludge presuming the variable name used by the macros.
    Using typeof makes sure to barf if we do not match the macro definition.
    This ifndef is a further bad kludge for Hurd, where there is an explicit
index a0a54fbd8d3df5b868bc63609c48cf7046772fe2..f2530afe5c4a7777f7cf93c26a59bf93a107b46b 100644 (file)
@@ -1,5 +1,5 @@
 /* Define current locale data for LC_CTYPE category.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2005
+   Copyright (C) 1995,1996,1997,1998,1999,2000,2002,2003,2005,2008
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -66,10 +66,11 @@ _nl_postload_ctype (void)
      in fact using the global locale.  */
   if (_NL_CURRENT_LOCALE == &_nl_global_locale)
     {
-      __libc_tsd_set (CTYPE_B, (void *) _nl_global_locale.__ctype_b);
-      __libc_tsd_set (CTYPE_TOUPPER,
+      __libc_tsd_set (const uint16_t *, CTYPE_B,
+                     (void *) _nl_global_locale.__ctype_b);
+      __libc_tsd_set (const int32_t *, CTYPE_TOUPPER,
                      (void *) _nl_global_locale.__ctype_toupper);
-      __libc_tsd_set (CTYPE_TOLOWER,
+      __libc_tsd_set (const int32_t *, CTYPE_TOLOWER,
                      (void *) _nl_global_locale.__ctype_tolower);
     }
 
index 5e3e99ca6843f3d745a6a84f10c41b19a6f9933d..3661080bb256c04eb78e26e03105bdc714359755 100644 (file)
@@ -1,5 +1,6 @@
 /* Declarations for internal libc locale interfaces
-   Copyright (C) 1995-2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-2003, 2005, 2006, 2007, 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
@@ -203,9 +204,9 @@ extern struct __locale_struct _nl_global_locale attribute_hidden;
 
 /* This fetches the thread-local locale_t pointer, either one set with
    uselocale or &_nl_global_locale.  */
-#define _NL_CURRENT_LOCALE     ((__locale_t) __libc_tsd_get (LOCALE))
+#define _NL_CURRENT_LOCALE     (__libc_tsd_get (__locale_t, LOCALE))
 #include <bits/libc-tsd.h>
-__libc_tsd_define (extern, LOCALE)
+__libc_tsd_define (extern, __locale_t, LOCALE)
 
 
 /* For static linking it is desireable to avoid always linking in the code
index 6a54b58a27bbb1b357e6bbdb8257f2ada6aa2135..ec5dc8f356e180b0d121206a0675a51b1e1ccb20 100644 (file)
@@ -1,5 +1,5 @@
 /* uselocale -- fetch and set the current per-thread locale
-   Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2007, 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
@@ -35,7 +35,7 @@ __uselocale (locale_t newloc)
     {
       const locale_t locobj
        = newloc == LC_GLOBAL_LOCALE ? &_nl_global_locale : newloc;
-      __libc_tsd_set (LOCALE, locobj);
+      __libc_tsd_set (__locale_t, LOCALE, locobj);
 
 #ifdef NL_CURRENT_INDIRECT
       /* Now we must update all the per-category thread-local variables to
@@ -63,9 +63,11 @@ __uselocale (locale_t newloc)
 #endif
 
       /* Update the special tsd cache of some locale data.  */
-      __libc_tsd_set (CTYPE_B, (void *) locobj->__ctype_b);
-      __libc_tsd_set (CTYPE_TOLOWER, (void *) locobj->__ctype_tolower);
-      __libc_tsd_set (CTYPE_TOUPPER, (void *) locobj->__ctype_toupper);
+      __libc_tsd_set (const uint16_t *, CTYPE_B, (void *) locobj->__ctype_b);
+      __libc_tsd_set (const int32_t *, CTYPE_TOLOWER,
+                     (void *) locobj->__ctype_tolower);
+      __libc_tsd_set (const int32_t *, CTYPE_TOUPPER,
+                     (void *) locobj->__ctype_toupper);
     }
 
   return oldloc == &_nl_global_locale ? LC_GLOBAL_LOCALE : oldloc;
index feca2cbea9db0ad1f9763c101f1da580980367cd..d6102a4528f8f2b8ea7a9e933512aff8aeb8596d 100644 (file)
@@ -3717,7 +3717,7 @@ public_rEALLOc(Void_t* oldmem, size_t bytes)
       newp = public_mALLOc(bytes);
       if (newp != NULL)
        {
-         MALLOC_COPY (newp, oldmem, oldsize - 2 * SIZE_SZ);
+         MALLOC_COPY (newp, oldmem, oldsize - SIZE_SZ);
 #if THREAD_STATS
          if(!mutex_trylock(&ar_ptr->mutex))
            ++(ar_ptr->stat_lock_direct);
index 4f45aaa0f2bb00dcfb96308357214394f1cf3215..eefdd26c9c513568d56a2bb54151a86e8d21e3d3 100644 (file)
 
 /* 1 if 'type' is a floating type, 0 if 'type' is an integer type.
    Allows for _Bool.  Expands to an integer constant expression.  */
-# define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+# if __GNUC_PREREQ (3, 1)
+#  define __floating_type(type) \
+  (__builtin_classify_type ((type) 0) == 8 \
+   || (__builtin_classify_type ((type) 0) == 9 \
+       && __builtin_classify_type (__real__ ((type) 0)) == 8))
+# else
+#  define __floating_type(type) (((type) 0.25) && ((type) 0.25 - 1))
+# endif
 
 /* The tgmath real type for T, where E is 0 if T is an integer type and
    1 for a floating type.  */
index cb4d67466b6249860c2c20da054abef0b433a258..c855a418464425d36eb04eb952a51dd7b8ba4237 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993,1995-1997,2002,2005,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1993,1995-1997,2002,2005,2007,2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1993.
 
@@ -154,18 +155,11 @@ hsearch_r (item, action, retval, htab)
     }
 
   /* First hash function: simply take the modul but prevent zero. */
-  hval %= htab->size;
-  if (hval == 0)
-    ++hval;
-
-  /* The first index tried. */
-  idx = hval;
+  idx = hval % htab->size + 1;
 
   if (htab->table[idx].used)
     {
       /* Further action might be required according to the action value. */
-      unsigned hval2;
-
       if (htab->table[idx].used == hval
          && strcmp (item.key, htab->table[idx].entry.key) == 0)
        {
@@ -174,7 +168,8 @@ hsearch_r (item, action, retval, htab)
        }
 
       /* Second hash function, as suggested in [Knuth] */
-      hval2 = 1 + hval % (htab->size - 2);
+      unsigned int hval2 = 1 + hval % (htab->size - 2);
+      unsigned int first_idx = idx;
 
       do
        {
@@ -186,7 +181,7 @@ hsearch_r (item, action, retval, htab)
            idx -= hval2;
 
          /* If we visited all entries leave the loop unsuccessfully.  */
-         if (idx == hval)
+         if (idx == first_idx)
            break;
 
             /* If entry is found use it. */
index acc8302c7566e8084c4aa33cabc3af7fb603a426..3d1136f4637eddfed1cb4cb35f6b8b3f1999bdbf 100644 (file)
@@ -1,3 +1,35 @@
+2008-11-12  Jakub Jelinek  <jakub@redhat.com>
+
+       [BZ #7008]
+       * pthread_condattr_setclock.c (pthread_condattr_setclock): Fix masking
+       of old value.
+       * pthread_cond_init.c (__pthread_cond_init): Fix
+       cond->__data.__nwaiters initialization.
+       * Makefile (tests): Add tst-cond23.
+       * tst-cond23.c: New test.
+
+2008-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * sysdeps/pthread/malloc-machine.h (MALLOC): Adjust __libc_tsd_define
+       arguments.
+       (tsd_setspecific, tsd_getspecific): Adjust __libc_tsd_{set,get}
+       arguments.
+
+2008-11-01  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #6955]
+       * pthread_mutex_lock.c: Add support for private PI mutexes.
+       * pthread_mutex_timedlock.c: Likewise.
+       * pthread_mutex_trylock.c: Likewise.
+       * pthread_mutex_unlock.c: Likewise.
+       Patch mostly by Ben Jackson <ben@ben.com>.
+
+2008-10-31  Ulrich Drepper  <drepper@redhat.com>
+
+       [BZ #6843]
+       * sysdeps/pthread/gai_misc.h (__gai_create_helper_thread):
+       Increase stack size for helper thread.
+
 2008-10-06  Martin Schwidefsky  <schwidefsky@de.ibm.com>
 
        * sysdeps/s390/tls.h (THREAD_SET_STACK_GUARD): Add empty inline
index 76d9e383e02e4dc8fb03af47acae6ccd3ad1e93c..74069493768bed6bdc7a017e1c410394b04202ae 100644 (file)
@@ -205,7 +205,7 @@ tests = tst-typesizes \
        tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
        tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
        tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
-       tst-cond20 tst-cond21 tst-cond22 \
+       tst-cond20 tst-cond21 tst-cond22 tst-cond23 \
        tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
        tst-robust6 tst-robust7 tst-robust8 tst-robust9 \
        tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
index a75b82b9cf94c641f1942edbc69057ea166ade6c..65c01b103c2ba3878a2b9a2683bee1ccf481b549 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -31,8 +32,9 @@ __pthread_cond_init (cond, cond_attr)
   cond->__data.__lock = LLL_LOCK_INITIALIZER;
   cond->__data.__futex = 0;
   cond->__data.__nwaiters = (icond_attr != NULL
-                            && ((icond_attr->value
-                                 & (COND_NWAITERS_SHIFT << 1)) >> 1));
+                            ? ((icond_attr->value >> 1)
+                               & ((1 << COND_NWAITERS_SHIFT) - 1))
+                            : CLOCK_REALTIME);
   cond->__data.__total_seq = 0;
   cond->__data.__wakeup_seq = 0;
   cond->__data.__woken_seq = 0;
index 9c03bce9fcf3746201ef017c45c5af86c53f806f..5c54f764e62fbd6449fe2c4d33b9d69ab9098dfd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
 
@@ -66,7 +66,7 @@ pthread_condattr_setclock (attr, clock_id)
 
   int *valuep = &((struct pthread_condattr *) attr)->value;
 
-  *valuep = ((*valuep & ~(1 << (COND_NWAITERS_SHIFT + 1)) & ~1)
+  *valuep = ((*valuep & ~(((1 << COND_NWAITERS_SHIFT) - 1) << 1))
             | (clock_id << 1));
 
   return 0;
index ed98dfc6c39e689b78ae438a1102847d964ee33c..3eb5636955b8a35d8bc36bc3c39b463e811ed861 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -269,9 +269,13 @@ __pthread_mutex_lock (mutex)
          {
            /* The mutex is locked.  The kernel will now take care of
               everything.  */
+           int private = (robust
+                          ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
+                          : PTHREAD_MUTEX_PSHARED (mutex));
            INTERNAL_SYSCALL_DECL (__err);
            int e = INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                                     FUTEX_LOCK_PI, 1, 0);
+                                     __lll_private_flag (FUTEX_LOCK_PI,
+                                                         private), 1, 0);
 
            if (INTERNAL_SYSCALL_ERROR_P (e, __err)
                && (INTERNAL_SYSCALL_ERRNO (e, __err) == ESRCH
@@ -327,7 +331,10 @@ __pthread_mutex_lock (mutex)
 
            INTERNAL_SYSCALL_DECL (__err);
            INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                             FUTEX_UNLOCK_PI, 0, 0);
+                             __lll_private_flag (FUTEX_UNLOCK_PI,
+                                                 PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
+),
+                             0, 0);
 
            THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
            return ENOTRECOVERABLE;
index 4bf0efea34a6664090fd6aeda7f3aae7c7272081..8d0db79d58e6c71e87c3093867f24c4502525f3c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -254,10 +254,15 @@ pthread_mutex_timedlock (mutex, abstime)
            /* The mutex is locked.  The kernel will now take care of
               everything.  The timeout value must be a relative value.
               Convert it.  */
+           int private = (robust
+                          ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
+                          : PTHREAD_MUTEX_PSHARED (mutex));
            INTERNAL_SYSCALL_DECL (__err);
 
            int e = INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                                     FUTEX_LOCK_PI, 1, abstime);
+                                     __lll_private_flag (FUTEX_LOCK_PI,
+                                                         private), 1,
+                                     abstime);
            if (INTERNAL_SYSCALL_ERROR_P (e, __err))
              {
                if (INTERNAL_SYSCALL_ERRNO (e, __err) == ETIMEDOUT)
@@ -331,7 +336,9 @@ pthread_mutex_timedlock (mutex, abstime)
 
            INTERNAL_SYSCALL_DECL (__err);
            INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                             FUTEX_UNLOCK_PI, 0, 0);
+                             __lll_private_flag (FUTEX_UNLOCK_PI,
+                                                 PTHREAD_ROBUST_MUTEX_PSHARED (mutex)),
+                             0, 0);
 
            THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
            return ENOTRECOVERABLE;
index f6e24d413893c3d5a255f97d0b3db69ee37f5be7..25029bedce7c6d43671a199cf52ebe1f7cc971bd 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -231,9 +231,13 @@ __pthread_mutex_trylock (mutex)
 
            /* The mutex owner died.  The kernel will now take care of
               everything.  */
+           int private = (robust
+                          ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
+                          : PTHREAD_MUTEX_PSHARED (mutex));
            INTERNAL_SYSCALL_DECL (__err);
            int e = INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                                     FUTEX_TRYLOCK_PI, 0, 0);
+                                     __lll_private_flag (FUTEX_TRYLOCK_PI,
+                                                         private), 0, 0);
 
            if (INTERNAL_SYSCALL_ERROR_P (e, __err)
                && INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK)
@@ -274,7 +278,9 @@ __pthread_mutex_trylock (mutex)
 
            INTERNAL_SYSCALL_DECL (__err);
            INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock,
-                             FUTEX_UNLOCK_PI, 0, 0);
+                             __lll_private_flag (FUTEX_UNLOCK_PI,
+                                                 PTHREAD_ROBUST_MUTEX_PSHARED (mutex)),
+                             0, 0);
 
            THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
            return ENOTRECOVERABLE;
index d33d0593d8d9c441435aebcdb441b67bde7f4d0b..a14c43ece7b4dd33e325a9537024550e97b2ce2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -196,9 +196,13 @@ __pthread_mutex_unlock_usercnt (mutex, decr)
                                                   THREAD_GETMEM (THREAD_SELF,
                                                                  tid)))
        {
+         int robust = mutex->__data.__kind & PTHREAD_MUTEX_ROBUST_NORMAL_NP;
+         int private = (robust
+                        ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex)
+                        : PTHREAD_MUTEX_PSHARED (mutex));
          INTERNAL_SYSCALL_DECL (__err);
          INTERNAL_SYSCALL (futex, __err, 2, &mutex->__data.__lock,
-                           FUTEX_UNLOCK_PI);
+                           __lll_private_flag (FUTEX_UNLOCK_PI, private));
        }
 
       THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL);
index 0a2686cb275bd4a3ea1e62d79fb0db0ace14736d..9094c1e37b92339ca26022edcfbd10838eba3734 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007, 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
@@ -97,7 +97,7 @@ __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
   pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
 
   /* The helper thread needs only very little resources.  */
-  (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+  (void) pthread_attr_setstacksize (&attr, 4 * PTHREAD_STACK_MIN);
 
   /* Block all signals in the helper thread.  To do this thoroughly we
      temporarily have to block all signals here.  */
index 33a3d205313cba7044ab5118637a340c9094c454..e99aaa781fad02e3b01cdb5e0b8a6b2026924297 100644 (file)
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007, 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
@@ -63,10 +63,10 @@ extern void *__dso_handle __attribute__ ((__weak__));
 #include <bits/libc-tsd.h>
 
 typedef int tsd_key_t[1];      /* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC)     /* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC)     /* declaration/common definition */
 #define tsd_key_create(key, destr)     ((void) (key))
-#define tsd_setspecific(key, data)     __libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data)     __libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (void *, MALLOC))
 
 #include <sysdeps/generic/malloc-machine.h>
 
diff --git a/nptl/tst-cond23.c b/nptl/tst-cond23.c
new file mode 100644 (file)
index 0000000..254d821
--- /dev/null
@@ -0,0 +1,184 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2008.
+
+   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 <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
+
+
+#if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
+static int
+check (pthread_condattr_t *condattr, int pshared, clockid_t cl)
+{
+  clockid_t cl2;
+  if (pthread_condattr_getclock (condattr, &cl2) != 0)
+    {
+      puts ("condattr_getclock failed");
+      return 1;
+    }
+  if (cl != cl2)
+    {
+      printf ("condattr_getclock returned wrong value: %d, expected %d\n",
+             (int) cl2, (int) cl);
+      return 1;
+    }
+
+  int p;
+  if (pthread_condattr_getpshared (condattr, &p) != 0)
+    {
+      puts ("condattr_getpshared failed");
+      return 1;
+    }
+  else if (p != pshared)
+    {
+      printf ("condattr_getpshared returned wrong value: %d, expected %d\n",
+             p, pshared);
+      return 1;
+    }
+
+  return 0;
+}
+
+static int
+run_test (clockid_t cl)
+{
+  pthread_condattr_t condattr;
+
+  printf ("clock = %d\n", (int) cl);
+
+  if (pthread_condattr_init (&condattr) != 0)
+    {
+      puts ("condattr_init failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_PRIVATE, CLOCK_REALTIME))
+    return 1;
+
+  if (pthread_condattr_setpshared (&condattr, PTHREAD_PROCESS_SHARED) != 0)
+    {
+      puts ("1st condattr_setpshared failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_SHARED, CLOCK_REALTIME))
+    return 1;
+
+  if (pthread_condattr_setclock (&condattr, cl) != 0)
+    {
+      puts ("1st condattr_setclock failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_SHARED, cl))
+    return 1;
+
+  if (pthread_condattr_setpshared (&condattr, PTHREAD_PROCESS_PRIVATE) != 0)
+    {
+      puts ("2nd condattr_setpshared failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_PRIVATE, cl))
+    return 1;
+
+  if (pthread_condattr_setclock (&condattr, CLOCK_REALTIME) != 0)
+    {
+      puts ("2nd condattr_setclock failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_PRIVATE, CLOCK_REALTIME))
+    return 1;
+
+  if (pthread_condattr_setclock (&condattr, cl) != 0)
+    {
+      puts ("3rd condattr_setclock failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_PRIVATE, cl))
+    return 1;
+
+  if (pthread_condattr_setpshared (&condattr, PTHREAD_PROCESS_SHARED) != 0)
+    {
+      puts ("3rd condattr_setpshared failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_SHARED, cl))
+    return 1;
+
+  if (pthread_condattr_setclock (&condattr, CLOCK_REALTIME) != 0)
+    {
+      puts ("4th condattr_setclock failed");
+      return 1;
+    }
+
+  if (check (&condattr, PTHREAD_PROCESS_SHARED, CLOCK_REALTIME))
+    return 1;
+
+  if (pthread_condattr_destroy (&condattr) != 0)
+    {
+      puts ("condattr_destroy failed");
+      return 1;
+    }
+
+  return 0;
+}
+#endif
+
+
+static int
+do_test (void)
+{
+#if !defined _POSIX_CLOCK_SELECTION || _POSIX_CLOCK_SELECTION == -1
+
+  puts ("_POSIX_CLOCK_SELECTION not supported, test skipped");
+  return 0;
+
+#else
+
+  int res = run_test (CLOCK_REALTIME);
+
+# if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
+#  if _POSIX_MONOTONIC_CLOCK == 0
+  int e = sysconf (_SC_MONOTONIC_CLOCK);
+  if (e < 0)
+    puts ("CLOCK_MONOTONIC not supported");
+  else if (e == 0)
+    {
+      puts ("sysconf (_SC_MONOTONIC_CLOCK) must not return 0");
+      res = 1;
+    }
+  else
+#  endif
+    res |= run_test (CLOCK_MONOTONIC);
+# else
+  puts ("_POSIX_MONOTONIC_CLOCK not defined");
+# endif
+
+  return res;
+#endif
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
index 4d43dec94679ffa5b5097b732d2f2011ac1d2598..6cbfcb63cebee9407ed74c481a7b27f31ad94602 100644 (file)
@@ -1083,11 +1083,18 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname,
            }
          continue;
        }
+#if 1
+      // We should not see any types other than those explicitly listed
+      // below.  Some types sent by server seem missing, though.  Just
+      // collect the data for now.
+      if (__builtin_expect (type != T_A && type != T_AAAA, 0))
+#else
       if (__builtin_expect (type == T_SIG, 0)
          || __builtin_expect (type == T_KEY, 0)
          || __builtin_expect (type == T_NXT, 0)
          || __builtin_expect (type == T_PTR, 0)
          || __builtin_expect (type == T_DNAME, 0))
+#endif
        {
          /* We don't support DNSSEC yet.  For now, ignore the record
             and send a low priority message to syslog.
index bda432d3cd0f2f1ac613687a569107d5a3d0e0f6..a3d227e524ca7d45c585a83e9e14f7de1fc33f02 100644 (file)
@@ -995,7 +995,11 @@ mkfile_output (struct commandline *cmd)
        abort ();
       temp = rindex (cmd->infile, '.');
       cp = stpcpy (mkfilename, "Makefile.");
-      strncpy (cp, cmd->infile, (temp - cmd->infile));
+      if (temp != NULL)
+       *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
+      else
+       stpcpy (cp, cmd->infile);
+
     }
   else
     mkfilename = (char *) cmd->outfile;
index 7a9cc9d62fba394c7b202a6530b7066e5ecf9887..796bf086fc32d87af19585cc48a8aac713cac369 100644 (file)
@@ -10,7 +10,7 @@
 
 /* Variable used in non-threaded applications or for the first thread.  */
 static struct rpc_thread_variables __libc_tsd_RPC_VARS_mem;
-__libc_tsd_define (, RPC_VARS)
+__libc_tsd_define (, struct rpc_thread_variables *, RPC_VARS)
 
 /*
  * Task-variable destructor
@@ -18,7 +18,8 @@ __libc_tsd_define (, RPC_VARS)
 void __attribute__ ((section ("__libc_thread_freeres_fn")))
 __rpc_thread_destroy (void)
 {
-       struct rpc_thread_variables *tvp = __libc_tsd_get (RPC_VARS);
+       struct rpc_thread_variables *tvp
+         = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
 
        if (tvp != NULL) {
                __rpc_thread_svc_cleanup ();
@@ -33,7 +34,7 @@ __rpc_thread_destroy (void)
                free (tvp->svc_pollfd_s);
                if (tvp != &__libc_tsd_RPC_VARS_mem)
                        free (tvp);
-               __libc_tsd_set (RPC_VARS, NULL);
+               __libc_tsd_set (struct rpc_thread_variables *, RPC_VARS, NULL);
        }
 }
 #ifdef _LIBC_REENTRANT
@@ -48,7 +49,8 @@ text_set_element (__libc_subfreeres, __rpc_thread_destroy);
 static void
 rpc_thread_multi (void)
 {
-  __libc_tsd_set (RPC_VARS, &__libc_tsd_RPC_VARS_mem);
+  __libc_tsd_set (struct rpc_thread_variables *, RPC_VARS,
+                 &__libc_tsd_RPC_VARS_mem);
 }
 
 
@@ -58,16 +60,18 @@ __rpc_thread_variables (void)
        __libc_once_define (static, once);
        struct rpc_thread_variables *tvp;
 
-       tvp = __libc_tsd_get (RPC_VARS);
+       tvp = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
        if (tvp == NULL) {
                __libc_once (once, rpc_thread_multi);
-               tvp = __libc_tsd_get (RPC_VARS);
+               tvp = __libc_tsd_get (struct rpc_thread_variables *, RPC_VARS);
                if (tvp == NULL) {
                        tvp = calloc (1, sizeof *tvp);
                        if (tvp != NULL)
-                               __libc_tsd_set (RPC_VARS, tvp);
+                               __libc_tsd_set (struct rpc_thread_variables *,
+                                               RPC_VARS, tvp);
                        else
-                               tvp = __libc_tsd_get (RPC_VARS);
+                               tvp = __libc_tsd_get (struct rpc_thread_variables *,
+                                                     RPC_VARS);
                }
        }
        return tvp;
index 56393e930d4fab6af80333d2a818c79a6e36e44a..926dd1fcc19444bb91e034b35971a05dbb19a1fd 100644 (file)
@@ -1,5 +1,5 @@
 /* libc-internal interface for thread-specific data.  Hurd version.
-   Copyright (C) 1998,2002 Free Software Foundation, Inc.
+   Copyright (C) 1998,2002,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
 
 #include <hurd/threadvar.h>
 
-#define __libc_tsd_define(CLASS, KEY) /* nothing, always have threadvars */
+#define __libc_tsd_define(CLASS, TYPE, KEY) /* nothing, always have threadvars */
 
-#define __libc_tsd_address(KEY) \
-  ((void **) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
-
-#define __libc_tsd_get(KEY)            (*__libc_tsd_address (KEY))
-#define __libc_tsd_set(KEY, VALUE)     (*__libc_tsd_address (KEY) = (VALUE))
+#define __libc_tsd_address(TYPE, KEY) \
+  ((TYPE *) __hurd_threadvar_location (_HURD_THREADVAR_##KEY))
 
+#define __libc_tsd_get(TYPE, KEY) \
+  (*__libc_tsd_address (TYPE, KEY))
+#define __libc_tsd_set(TYPE, KEY, VALUE) \
+  (*__libc_tsd_address (TYPE, KEY) = (VALUE))
 
 #endif /* bits/libc-tsd.h */
index 70aaf11b87fc400b7765ca1b2f330edcdea1768e..e6078f60dc50eee50202f45856e9a337fd1e9ce4 100644 (file)
@@ -1,6 +1,6 @@
 /* Basic platform-independent macro definitions for mutexes,
    thread-specific data and parameters for malloc.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 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
 #include <bits/libc-tsd.h>
 
 typedef int tsd_key_t[1];      /* no key data structure, libc magic does it */
-__libc_tsd_define (static, MALLOC)     /* declaration/common definition */
+__libc_tsd_define (static, void *, MALLOC)     /* declaration/common definition */
 #define tsd_key_create(key, destr)     ((void) (key))
-#define tsd_setspecific(key, data)     __libc_tsd_set (MALLOC, (data))
-#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (MALLOC))
+#define tsd_setspecific(key, data)     __libc_tsd_set (void *, MALLOC, (data))
+#define tsd_getspecific(key, vptr)     ((vptr) = __libc_tsd_get (void *, MALLOC))
 
 #include <sysdeps/generic/malloc-machine.h>
 
index aa004734138c37a4ba426e1ea2e6b38702841e7c..95d0390d09dfff5b244eb5af60fe3be461668863 100644 (file)
@@ -56,7 +56,7 @@ typedef uintmax_t uatomic_max_t;
      __typeof (*mem) __archold = (oldval);                                   \
      __asm __volatile ("cs %0,%2,%1"                                         \
                       : "+d" (__archold), "=Q" (*__archmem)                  \
-                      : "d" (newval), "m" (*__archmem) : "cc" );             \
+                      : "d" (newval), "m" (*__archmem) : "cc", "memory" );           \
      __archold; })
 
 #ifdef __s390x__
@@ -65,7 +65,7 @@ typedef uintmax_t uatomic_max_t;
      __typeof (*mem) __archold = (oldval);                                   \
      __asm __volatile ("csg %0,%2,%1"                                        \
                       : "+d" (__archold), "=Q" (*__archmem)                  \
-                      : "d" ((long) (newval)), "m" (*__archmem) : "cc" );    \
+                      : "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" );    \
      __archold; })
 #else
 /* For 31 bit we do not really need 64-bit compare-and-exchange. We can
index 80935821632e6a561d66104d36bf1660318ddf5f..72043c9779b4a1b817eb8102c3e7f8705890a76d 100644 (file)
@@ -91,7 +91,7 @@ _dl_runtime_profile:
        ld     %f4,120(%r12)
        ld     %f6,128(%r12)
        basr   %r14,%r1                 # call resolved function
-0:     l    %r15,%r12                # remove stack frame
+0:     lgr    %r15,%r12                # remove stack frame
        cfi_def_cfa_register (15)
        lg     %r14,32(%r15)            # restore registers
        lg     %r12,24(%r15)
diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
new file mode 100644 (file)
index 0000000..bd699bb
--- /dev/null
@@ -0,0 +1,3 @@
+# The i386 fragment also works for x86_64.
+
+. $srcdir/sysdeps/i386/configure