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

[commits] r2244 - in /trunk/libc: ./ elf/ include/ include/sys/ io/ io/sys/ locale/programs/ localedata/ localedata/locales/ malloc/ n...



Author: joseph
Date: Wed May 16 07:10:16 2007
New Revision: 2244

Log:
Merge changes between r2162 and r2243 from /fsf/trunk.

Added:
    trunk/libc/io/futimens.c
      - copied unchanged from r2243, fsf/trunk/libc/io/futimens.c
    trunk/libc/io/utimensat.c
      - copied unchanged from r2243, fsf/trunk/libc/io/utimensat.c
    trunk/libc/localedata/locales/ast_ES
      - copied unchanged from r2243, fsf/trunk/libc/localedata/locales/ast_ES
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c
      - copied unchanged from r2243, fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c
    trunk/libc/sysdeps/powerpc/fpu/fe_mask.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/powerpc/fpu/fe_mask.c
    trunk/libc/sysdeps/unix/sysv/linux/futimens.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/futimens.c
    trunk/libc/sysdeps/unix/sysv/linux/lutimes.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/lutimes.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c
    trunk/libc/sysdeps/unix/sysv/linux/tst-getcpu.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/tst-getcpu.c
    trunk/libc/sysdeps/unix/sysv/linux/utimensat.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/utimensat.c
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c
      - copied unchanged from r2243, fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c
Removed:
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
Modified:
    trunk/libc/ChangeLog
    trunk/libc/README
    trunk/libc/elf/dl-addr.c
    trunk/libc/elf/dl-close.c
    trunk/libc/elf/dl-open.c
    trunk/libc/include/features.h
    trunk/libc/include/link.h
    trunk/libc/include/sys/cdefs.h
    trunk/libc/io/Makefile
    trunk/libc/io/Versions
    trunk/libc/io/sys/stat.h
    trunk/libc/locale/programs/linereader.c
    trunk/libc/localedata/ChangeLog
    trunk/libc/localedata/SUPPORTED
    trunk/libc/localedata/locales/as_IN
    trunk/libc/malloc/Makefile
    trunk/libc/malloc/arena.c
    trunk/libc/malloc/hooks.c
    trunk/libc/malloc/malloc.c
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/TODO
    trunk/libc/nptl/allocatestack.c
    trunk/libc/nptl/descr.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
    trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
    trunk/libc/nptl/tst-align2.c
    trunk/libc/nptl/tst-cancel-wrappers.sh
    trunk/libc/nptl/tst-cancel4.c
    trunk/libc/nptl/tst-getpid1.c
    trunk/libc/posix/unistd.h
    trunk/libc/scripts/check-c++-types.sh
    trunk/libc/stdio-common/vfprintf.c
    trunk/libc/string/strfry.c
    trunk/libc/sysdeps/alpha/fpu/bits/mathinline.h
    trunk/libc/sysdeps/alpha/fpu/s_fmax.S
    trunk/libc/sysdeps/alpha/fpu/s_fmin.S
    trunk/libc/sysdeps/alpha/fpu/s_isnan.c
    trunk/libc/sysdeps/alpha/fpu/s_lrint.c
    trunk/libc/sysdeps/alpha/fpu/s_lround.c
    trunk/libc/sysdeps/alpha/fpu/s_nearbyint.c
    trunk/libc/sysdeps/alpha/fpu/s_round.c
    trunk/libc/sysdeps/alpha/fpu/s_trunc.c
    trunk/libc/sysdeps/ia64/fpu/fraiseexcpt.c
    trunk/libc/sysdeps/powerpc/bits/fenv.h
    trunk/libc/sysdeps/powerpc/fpu/Makefile
    trunk/libc/sysdeps/powerpc/fpu/fe_nomask.c
    trunk/libc/sysdeps/powerpc/fpu/fedisblxcpt.c
    trunk/libc/sysdeps/powerpc/fpu/feholdexcpt.c
    trunk/libc/sysdeps/powerpc/fpu/fesetenv.c
    trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c
    trunk/libc/sysdeps/s390/fpu/feholdexcpt.c
    trunk/libc/sysdeps/unix/sysv/linux/Makefile
    trunk/libc/sysdeps/unix/sysv/linux/alpha/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/alpha/ioperm.c
    trunk/libc/sysdeps/unix/sysv/linux/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/futimes.c
    trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/s390/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/sched_setaffinity.c
    trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/stat.h
    trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
    trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
    trunk/libc/version.h

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Wed May 16 07:10:16 2007
@@ -1,3 +1,177 @@
+2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* version.h (VERSION): Define to 6.
+	* include/features.h (__GLIBC_MINOR__): Likewise.
+
+	* malloc/malloc.c: Use all small bin slots on 64-bit archs.
+
+	* malloc/malloc.c (largebin_index): Really have 32 buckets with 64
+	sizes.
+
+2007-05-13  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* malloc/malloc.c [MALLOC_DEBUG]: Keep track of current maximum
+	number of mmaps.  n_mmaps_max is the target.
+	* malloc/hooks.c: Likewise.
+	* malloc/arena.c: Likewise.
+
+2007-05-12  Andreas Jaeger  <aj@xxxxxxx>
+
+	* sysdeps/unix/sysv/linux/tst-getcpu.c: Include <unistd.h> for
+	getpid.
+
+2007-05-11  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-close.c (_dl_close_worker): Help gcc to optimize by
+	adding new variables.
+
+	* elf/dl-open.c (add_to_global): Introduce variable ns to help gcc
+	optimize.  Completely extend global scope array before making the
+	new entries visible.
+
+2007-05-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/tst-getcpu.c: New file.
+	* sysdeps/unix/sysv/linux/Makefile [subdir=posix] (tests): Add
+	tst-getcpu.
+
+	* include/link.h: Move l_version and l_nversion members around to
+	fill gaps.
+
+	* scripts/check-c++-types.sh: Don't use -fnu89-inline option.
+
+	* sysdeps/unix/sysv/linux/sched_setaffinity.c
+	(__sched_setaffinity_new): If syscall was successful and
+	RESET_VGETCPU_CACHE is defined, use it before returning.
+	* sysdeps/unix/sysv/linux/x86_64/sched_setaffinity.c: New file.
+
+	* io/sys/stat.h: Make sure struct timespec is defined for
+	__USE_ATFILE.
+
+	* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Define UTIME_NOW and
+	UTIME_OMIT.
+	* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/alpha/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise.
+	* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_UTIMENSAT.
+	* io/sys/stat.h: Declare utimensat, futimens.
+	* io/utimensat.c: New file.
+	* io/futimens.c: New file.
+	* sysdeps/unix/sysv/linux/utimensat.c: New file.
+	* sysdeps/unix/sysv/linux/futimens.c: New file.
+	* io/Makefile (routines): Add utimensat, futimens.
+	* io/Versions: Add utimensat, futimens to GLIBC_2.6.
+	* sysdeps/unix/sysv/linux/lutimes.c: New file.
+	* sysdeps/unix/sysv/linux/futimes.c: Use utimensat syscall if
+	available.
+
+	* include/sys/cdefs.h: Redefine __nonnull so that test for
+	incorrect parameters in the libc code itself are not omitted.
+
+2007-05-09  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/ia64/fpu/fraiseexcpt.c (feraiseexcept): Don't raise overflow
+	exception in addition to inexact when asked to raise only FE_INEXACT.
+
+	[BZ #3427]
+	* sysdeps/s390/fpu/feholdexcpt.c (feholdexcept): Don't clear exceptions
+	in *envp.
+
+2007-05-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4403]
+	* string/strfry.c (strfry): Make result more random.
+
+2007-05-07  Richard Henderson  <rth@xxxxxxxxxx>
+
+	* sysdeps/alpha/fpu/bits/mathinline.h (__isnanl): Don't define
+	if __NO_LONG_DOUBLE_MATH.
+	* sysdeps/unix/sysv/linux/alpha/ioperm.c: If BWX insns not
+	available in the compiler, add .arch directive to the assembly.
+
+2007-05-07  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/alpha/fpu/s_nearbyint.c (nearbyintl): Fix version on
+	compat_symbol to GLIBC_2_1.
+	* sysdeps/alpha/fpu/s_fmin.S (fminl): Likewise.
+	* sysdeps/alpha/fpu/s_trunc.c (truncl): Likewise.
+	* sysdeps/alpha/fpu/s_fmax.S (fmaxl): Likewise.
+	* sysdeps/alpha/fpu/s_lrint.c (lrintl, llrintl): Likewise.
+	* sysdeps/alpha/fpu/s_lround.c (lroundl, llroundl): Likewise.
+	* sysdeps/alpha/fpu/s_round.c (roundl): Likewise.
+	* sysdeps/alpha/fpu/s_isnan.c (isnanl): Provide compat_symbol in
+	libc, not libm.
+	(__isnanl): New compat_symbol.
+
+2007-05-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+	    Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* malloc/arena.c (heap_info): Add mprotect_size field, adjust pad.
+	(new_heap): Initialize mprotect_size.
+	(grow_heap): When growing, only mprotect from mprotect_size till
+	new_size if mprotect_size is smaller.  When shrinking, use PROT_NONE
+	MMAP for __libc_enable_secure only, otherwise use MADV_DONTNEED.
+
+2007-04-30  Steven Munroe  <sjmunroe@xxxxxxxxxx>
+	    Peter Bergner  <bergner@xxxxxxxxxx>
+
+	* sysdeps/powerpc/bits/fenv.h: Declare __fe_mask_env extern.
+	Define FE_NOMASK_ENV as FE_EANBLED_ENV.  Define FE_MASK_ENV.
+	* sysdeps/powerpc/fpu/Makefile: Add fe_mask to libm-support.
+	* sysdeps/powerpc/fpu/fe_mask.c: New file.
+	* sysdeps/powerpc/fpu/fe_nomask.c: Correct comment.
+	* sysdeps/powerpc/fpu/fedisblxcpt.c (fedisableexcept):
+	Call __fe_mask_env() if all FP exceptions disabled.
+	* sysdeps/powerpc/fpu/feholdexcpt.c (feholdexcept): Copy high 32-bits
+	from old FPSCR to new fenv to propagate DFP rounding modes.
+	Call __fe_mask_env() if FP exceptions previously enabled.
+	* sysdeps/powerpc/fpu/fesetenv.c (fesetenv): Change mask to merge
+	exceptions from env.  Use __fe_nomask_env() or __fe_mask_env() when
+	transitioning from all exceptions disabled to any exception enabled
+	or visa versa.
+	* sysdeps/powerpc/fpu/feupdateenv.c (__feupdateenv): Change mask to
+	merge exceptions from env.  Call __fe_nomask_env or __fe_mask_env
+	when transitioning from all exceptions disabled to any exception
+	enabled or visa versa.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fe_nomask.c: Moved to...
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c: ...here.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c: Moved to...
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c: ...here.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c: New file.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c: New file.
+
+2007-05-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4465]
+	* posix/unistd.h: Remove __THROW from fdatasync.
+
+2007-05-06  Mike Frysinger  <vapier@xxxxxxxxxx>
+
+	[BZ #4465]
+	* sysdeps/unix/sysv/linux/syscalls.list (fdatasync): Add "C" to args.
+
+2007-05-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdio-common/vfprintf.c (process_string_arg): Optimize
+	ridiculous precision in wide char code printing multi-byte string.
+	Reported by Jim Meyering <jim@xxxxxxxxxxxx>.
+
+	[BZ #4131]
+	* elf/dl-addr.c (_dl_addr): Compare address with actual segment
+	boundaries to work around systems with overlapping binary loading.
+	Based on a patch by Suzuki <suzuki@xxxxxxxxxx>.
+
+2007-05-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* stdio-common/vfprintf.c (process_string_arg): Adjust call to
+	__mbsnrtowcs after last change.
+
+	* locale/programs/linereader.c (get_symname): Fix adding final NUL.
+	(get_ident): Likewise.
+
 2007-05-03  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* soft-fp/op-common.h (FP_TRUNC): Replace raising of FP_EX_INEXACT
@@ -27,8 +201,10 @@
 	(FP_PACK_SEMIRAW_EP): Use FP_PACK_RAW_EP instead of
 	undefined _FP_PACK_RAW_EP.
 
-	* op-2.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_2.
-	* op-4.h (_FP_FRAC_COPY_2_2): Define as alias to _FP_FRAC_COPY_4.
+	* soft-fp/op-2.h (_FP_FRAC_COPY_2_2): Define as alias to
+	_FP_FRAC_COPY_2.
+	* soft-fp/op-4.h (_FP_FRAC_COPY_2_2): Define as alias to
+	_FP_FRAC_COPY_4.
 
 2007-04-16  Uros Bizjak  <ubizjak@xxxxxxxxx>
 	    Jakub Jelinek  <jakub@xxxxxxxxxx>
@@ -698,7 +874,7 @@
 
 2007-03-13  Richard Henderson  <rth@xxxxxxxxxx>
 
-        * elf/dl-support.c (_dl_aux_init): Honor DL_PLATFORM_AUXV.
+	* elf/dl-support.c (_dl_aux_init): Honor DL_PLATFORM_AUXV.
 	* sysdeps/unix/sysv/linux/alpha/dl-auxv.h: New file.
 	* sysdeps/unix/sysv/linux/alpha/dl-support.c: New file.
 	* sysdeps/unix/sysv/linux/alpha/dl-sysdep.c (__libc_alpha_cache_shape):

Modified: trunk/libc/README
==============================================================================
--- trunk/libc/README (original)
+++ trunk/libc/README Wed May 16 07:10:16 2007
@@ -26,7 +26,7 @@
 
 ---
 
-This directory contains the version 2.5 release of the GNU C Library.
+This directory contains the version 2.6 release of the GNU C Library.
 
 The GNU C Library is the standard system C library for all GNU systems,
 and is an important part of what makes up a GNU system.  It provides the
@@ -80,7 +80,7 @@
 
 The code for other CPU configurations supported by volunteers outside of
 the core glibc maintenance effort is contained in the separate `ports'
-add-on.  You can find glibc-ports-2.5 distributed separately in the
+add-on.  You can find glibc-ports-2.6 distributed separately in the
 same place where you got the main glibc distribution files.
 Currently these configurations are known to work using the `ports' add-on:
 

Modified: trunk/libc/elf/dl-addr.c
==============================================================================
--- trunk/libc/elf/dl-addr.c (original)
+++ trunk/libc/elf/dl-addr.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Locate the shared object symbol nearest a given address.
-   Copyright (C) 1996-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2005, 2006, 2007 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
@@ -22,137 +22,137 @@
 #include <ldsodefs.h>
 
 
+static void
+__attribute ((always_inline))
+determine_info (const ElfW(Addr) addr, struct link_map *match, Dl_info *info,
+		struct link_map **mapp, const ElfW(Sym) **symbolp)
+{
+  /* Now we know what object the address lies in.  */
+  info->dli_fname = match->l_name;
+  info->dli_fbase = (void *) match->l_map_start;
+
+  /* If this is the main program the information is incomplete.  */
+  if (__builtin_expect (match->l_name[0], 'a') == '\0'
+      && match->l_type == lt_executable)
+    info->dli_fname = _dl_argv[0];
+
+  const ElfW(Sym) *symtab
+    = (const ElfW(Sym) *) D_PTR (match, l_info[DT_SYMTAB]);
+  const char *strtab = (const char *) D_PTR (match, l_info[DT_STRTAB]);
+
+  ElfW(Word) strtabsize = match->l_info[DT_STRSZ]->d_un.d_val;
+
+  const ElfW(Sym) *matchsym = NULL;
+  if (match->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM + DT_THISPROCNUM
+		    + DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] != NULL)
+    {
+      /* We look at all symbol table entries referenced by the hash
+	 table.  */
+      for (Elf_Symndx bucket = 0; bucket < match->l_nbuckets; ++bucket)
+	{
+	  Elf32_Word symndx = match->l_gnu_buckets[bucket];
+	  if (symndx != 0)
+	    {
+	      const Elf32_Word *hasharr = &match->l_gnu_chain_zero[symndx];
+
+	      do
+		{
+		  /* The hash table never references local symbols so
+		     we can omit that test here.  */
+		  if ((symtab[symndx].st_shndx != SHN_UNDEF
+		       || symtab[symndx].st_value != 0)
+		      && ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
+		      && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
+					    matchsym, addr)
+		      && symtab[symndx].st_name < strtabsize)
+		    matchsym = (ElfW(Sym) *) &symtab[symndx];
+
+		  ++symndx;
+		}
+	      while ((*hasharr++ & 1u) == 0);
+	    }
+	}
+    }
+  else
+    {
+      const ElfW(Sym) *symtabend;
+      if (match->l_info[DT_HASH] != NULL)
+	symtabend = (symtab
+		     + ((Elf_Symndx *) D_PTR (match, l_info[DT_HASH]))[1]);
+      else
+	/* There is no direct way to determine the number of symbols in the
+	   dynamic symbol table and no hash table is present.  The ELF
+	   binary is ill-formed but what shall we do?  Use the beginning of
+	   the string table which generally follows the symbol table.  */
+	symtabend = (const ElfW(Sym) *) strtab;
+
+      for (; (void *) symtab < (void *) symtabend; ++symtab)
+	if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
+	     || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
+	    && ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
+	    && (symtab->st_shndx != SHN_UNDEF
+		|| symtab->st_value != 0)
+	    && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
+	    && symtab->st_name < strtabsize)
+	  matchsym = (ElfW(Sym) *) symtab;
+    }
+
+  if (mapp)
+    *mapp = match;
+  if (symbolp)
+    *symbolp = matchsym;
+
+  if (matchsym)
+    {
+      /* We found a symbol close by.  Fill in its name and exact
+	 address.  */
+      lookup_t matchl = LOOKUP_VALUE (match);
+
+      info->dli_sname = strtab + matchsym->st_name;
+      info->dli_saddr = DL_SYMBOL_ADDRESS (matchl, matchsym);
+    }
+  else
+    {
+      /* No symbol matches.  We return only the containing object.  */
+      info->dli_sname = NULL;
+      info->dli_saddr = NULL;
+    }
+}
+
+
 int
 internal_function
 _dl_addr (const void *address, Dl_info *info,
 	  struct link_map **mapp, const ElfW(Sym) **symbolp)
 {
   const ElfW(Addr) addr = DL_LOOKUP_ADDRESS (address);
+  int result = 0;
 
   /* Protect against concurrent loads and unloads.  */
   __rtld_lock_lock_recursive (GL(dl_load_lock));
 
   /* Find the highest-addressed object that ADDRESS is not below.  */
-  struct link_map *match = NULL;
   for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
     for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l; l = l->l_next)
       if (addr >= l->l_map_start && addr < l->l_map_end)
 	{
-	  /* We know ADDRESS lies within L if in any shared object.
-	     Make sure it isn't past the end of L's segments.  */
-	  size_t n = l->l_phnum;
-	  if (n > 0)
-	    {
-	      do
-		--n;
-	      while (l->l_phdr[n].p_type != PT_LOAD);
-	      if (addr >= (l->l_addr +
-			   l->l_phdr[n].p_vaddr + l->l_phdr[n].p_memsz))
-		/* Off the end of the highest-addressed shared object.  */
-		continue;
-	    }
-
-	  match = l;
-	  break;
+	  /* Make sure it lies within one of L's segments.  */
+	  int n = l->l_phnum;
+	  const ElfW(Addr) reladdr = addr - l->l_addr;
+	  while (--n >= 0)
+	    if (l->l_phdr[n].p_type == PT_LOAD)
+	      {
+		if (reladdr - l->l_phdr[n].p_vaddr >= 0
+		    && reladdr - l->l_phdr[n].p_vaddr < l->l_phdr[n].p_memsz)
+		  {
+		    determine_info (addr, l, info, mapp, symbolp);
+		    result = 1;
+		    goto out;
+		  }
+	      }
 	}
 
-  int result = 0;
-  if (match != NULL)
-    {
-      /* Now we know what object the address lies in.  */
-      info->dli_fname = match->l_name;
-      info->dli_fbase = (void *) match->l_map_start;
-
-      /* If this is the main program the information is incomplete.  */
-      if (__builtin_expect (match->l_name[0], 'a') == '\0'
-	  && match->l_type == lt_executable)
-	info->dli_fname = _dl_argv[0];
-
-      const ElfW(Sym) *symtab
-	= (const ElfW(Sym) *) D_PTR (match, l_info[DT_SYMTAB]);
-      const char *strtab = (const char *) D_PTR (match, l_info[DT_STRTAB]);
-
-      ElfW(Word) strtabsize = match->l_info[DT_STRSZ]->d_un.d_val;
-
-      const ElfW(Sym) *matchsym = NULL;
-      if (match->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM + DT_THISPROCNUM
-			+ DT_VERSIONTAGNUM + DT_EXTRANUM + DT_VALNUM] != NULL)
-	{
-	  /* We look at all symbol table entries referenced by the
-	     hash table.  */
-	  for (Elf_Symndx bucket = 0; bucket < match->l_nbuckets; ++bucket)
-	    {
-	      Elf32_Word symndx = match->l_gnu_buckets[bucket];
-	      if (symndx != 0)
-		{
-		  const Elf32_Word *hasharr = &match->l_gnu_chain_zero[symndx];
-
-		  do
-		    {
-		      /* The hash table never references local symbols
-			 so we can omit that test here.  */
-		      if ((symtab[symndx].st_shndx != SHN_UNDEF
-			   || symtab[symndx].st_value != 0)
-			  && ELFW(ST_TYPE) (symtab[symndx].st_info) != STT_TLS
-			  && DL_ADDR_SYM_MATCH (match, &symtab[symndx],
-						matchsym, addr)
-			  && symtab[symndx].st_name < strtabsize)
-			matchsym = (ElfW(Sym) *) &symtab[symndx];
-
-		      ++symndx;
-		    }
-		  while ((*hasharr++ & 1u) == 0);
-		}
-	    }
-	}
-      else
-	{
-	  const ElfW(Sym) *symtabend;
-	  if (match->l_info[DT_HASH] != NULL)
-	    symtabend = (symtab
-			 + ((Elf_Symndx *) D_PTR (match, l_info[DT_HASH]))[1]);
-	  else
-	    /* There is no direct way to determine the number of symbols in the
-	       dynamic symbol table and no hash table is present.  The ELF
-	       binary is ill-formed but what shall we do?  Use the beginning of
-	       the string table which generally follows the symbol table.  */
-	    symtabend = (const ElfW(Sym) *) strtab;
-
-	  for (; (void *) symtab < (void *) symtabend; ++symtab)
-	    if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
-		 || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
-		&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
-		&& (symtab->st_shndx != SHN_UNDEF
-		    || symtab->st_value != 0)
-		&& DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
-		&& symtab->st_name < strtabsize)
-	      matchsym = (ElfW(Sym) *) symtab;
-	}
-
-      if (mapp)
-	*mapp = match;
-      if (symbolp)
-	*symbolp = matchsym;
-
-      if (matchsym)
-	{
-	  /* We found a symbol close by.  Fill in its name and exact
-	     address.  */
-	  lookup_t matchl = LOOKUP_VALUE (match);
-
-	  info->dli_sname = strtab + matchsym->st_name;
-	  info->dli_saddr = DL_SYMBOL_ADDRESS (matchl, matchsym);
-	}
-      else
-	{
-	  /* No symbol matches.  We return only the containing object.  */
-	  info->dli_sname = NULL;
-	  info->dli_saddr = NULL;
-	}
-
-      result = 1;
-    }
-
+ out:
   __rtld_lock_unlock_recursive (GL(dl_load_lock));
 
   return result;

Modified: trunk/libc/elf/dl-close.c
==============================================================================
--- trunk/libc/elf/dl-close.c (original)
+++ trunk/libc/elf/dl-close.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Close a shared object opened by `_dl_open'.
-   Copyright (C) 1996-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2005, 2006, 2007 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
@@ -107,8 +107,6 @@
 void
 _dl_close_worker (struct link_map *map)
 {
-  Lmid_t ns = map->l_ns;
-
   /* One less direct use.  */
   --map->l_direct_opencount;
 
@@ -131,11 +129,14 @@
       return;
     }
 
+  Lmid_t nsid = map->l_ns;
+  struct link_namespaces *ns = &GL(dl_ns)[nsid];
+
  retry:
   dl_close_state = pending;
 
   bool any_tls = false;
-  const unsigned int nloaded = GL(dl_ns)[ns]._ns_nloaded;
+  const unsigned int nloaded = ns->_ns_nloaded;
   char used[nloaded];
   char done[nloaded];
   struct link_map *maps[nloaded];
@@ -143,7 +144,7 @@
   /* Run over the list and assign indexes to the link maps and enter
      them into the MAPS array.  */
   int idx = 0;
-  for (struct link_map *l = GL(dl_ns)[ns]._ns_loaded; l != NULL; l = l->l_next)
+  for (struct link_map *l = ns->_ns_loaded; l != NULL; l = l->l_next)
     {
       l->l_idx = idx;
       maps[idx] = l;
@@ -220,11 +221,11 @@
     }
 
   /* Sort the entries.  */
-  _dl_sort_fini (GL(dl_ns)[ns]._ns_loaded, maps, nloaded, used, ns);
+  _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
 
   /* Call all termination functions at once.  */
 #ifdef SHARED
-  bool do_audit = GLRO(dl_naudit) > 0 && !GL(dl_ns)[ns]._ns_loaded->l_auditing;
+  bool do_audit = GLRO(dl_naudit) > 0 && !ns->_ns_loaded->l_auditing;
 #endif
   bool unload_any = false;
   unsigned int first_loaded = ~0;
@@ -233,7 +234,7 @@
       struct link_map *imap = maps[i];
 
       /* All elements must be in the same namespace.  */
-      assert (imap->l_ns == ns);
+      assert (imap->l_ns == nsid);
 
       if (!used[i])
 	{
@@ -248,7 +249,7 @@
 	      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS,
 				    0))
 		_dl_debug_printf ("\ncalling fini: %s [%lu]\n\n",
-				  imap->l_name, ns);
+				  imap->l_name, nsid);
 
 	      if (imap->l_info[DT_FINI_ARRAY] != NULL)
 		{
@@ -334,7 +335,7 @@
 		struct link_map *tmap = (struct link_map *)
 		  ((char *) imap->l_scope[cnt]
 		   - offsetof (struct link_map, l_searchlist));
-		assert (tmap->l_ns == ns);
+		assert (tmap->l_ns == nsid);
 		if (tmap->l_idx == IDX_STILL_USED)
 		  ++remain;
 		else
@@ -435,7 +436,7 @@
   /* Auditing checkpoint: we will start deleting objects.  */
   if (__builtin_expect (do_audit, 0))
     {
-      struct link_map *head = GL(dl_ns)[ns]._ns_loaded;
+      struct link_map *head = ns->_ns_loaded;
       struct audit_ifaces *afct = GLRO(dl_audit);
       /* Do not call the functions for any auditing object.  */
       if (head->l_auditing == 0)
@@ -452,7 +453,7 @@
 #endif
 
   /* Notify the debugger we are about to remove some loaded objects.  */
-  struct r_debug *r = _dl_debug_initialize (0, ns);
+  struct r_debug *r = _dl_debug_initialize (0, nsid);
   r->r_state = RT_DELETE;
   _dl_debug_state ();
 
@@ -474,19 +475,18 @@
 	  if (__builtin_expect (imap->l_global, 0))
 	    {
 	      /* This object is in the global scope list.  Remove it.  */
-	      unsigned int cnt = GL(dl_ns)[ns]._ns_main_searchlist->r_nlist;
+	      struct r_scope_elem *ns_msl = ns->_ns_main_searchlist;
+	      unsigned int cnt = ns_msl->r_nlist;
 
 	      do
 		--cnt;
-	      while (GL(dl_ns)[ns]._ns_main_searchlist->r_list[cnt] != imap);
+	      while (ns_msl->r_list[cnt] != imap);
 
 	      /* The object was already correctly registered.  */
-	      while (++cnt
-		     < GL(dl_ns)[ns]._ns_main_searchlist->r_nlist)
-		GL(dl_ns)[ns]._ns_main_searchlist->r_list[cnt - 1]
-		  = GL(dl_ns)[ns]._ns_main_searchlist->r_list[cnt];
-
-	      --GL(dl_ns)[ns]._ns_main_searchlist->r_nlist;
+	      while (++cnt < ns_msl->r_nlist)
+		ns_msl->r_list[cnt - 1] = ns_msl->r_list[cnt];
+
+	      --ns_msl->r_nlist;
 	    }
 
 	  /* Remove the object from the dtv slotinfo array if it uses TLS.  */
@@ -581,12 +581,12 @@
 	  else
 	    {
 #ifdef SHARED
-	      assert (ns != LM_ID_BASE);
+	      assert (nsid != LM_ID_BASE);
 #endif
-	      GL(dl_ns)[ns]._ns_loaded = imap->l_next;
-	    }
-
-	  --GL(dl_ns)[ns]._ns_nloaded;
+	      ns->_ns_loaded = imap->l_next;
+	    }
+
+	  --ns->_ns_nloaded;
 	  if (imap->l_next != NULL)
 	    imap->l_next->l_prev = imap->l_prev;
 
@@ -648,7 +648,7 @@
   /* Auditing checkpoint: we have deleted all objects.  */
   if (__builtin_expect (do_audit, 0))
     {
-      struct link_map *head = GL(dl_ns)[ns]._ns_loaded;
+      struct link_map *head = ns->_ns_loaded;
       /* Do not call the functions for any auditing object.  */
       if (head->l_auditing == 0)
 	{
@@ -732,22 +732,22 @@
 
 libc_freeres_fn (free_mem)
 {
-  for (Lmid_t ns = 0; ns < DL_NNS; ++ns)
-    if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0
-	&& (GL(dl_ns)[ns]._ns_main_searchlist->r_nlist
+  for (Lmid_t nsid = 0; nsid < DL_NNS; ++nsid)
+    if (__builtin_expect (GL(dl_ns)[nsid]._ns_global_scope_alloc, 0) != 0
+	&& (GL(dl_ns)[nsid]._ns_main_searchlist->r_nlist
 	    // XXX Check whether we need NS-specific initial_searchlist
 	    == GLRO(dl_initial_searchlist).r_nlist))
       {
 	/* All object dynamically loaded by the program are unloaded.  Free
 	   the memory allocated for the global scope variable.  */
-	struct link_map **old = GL(dl_ns)[ns]._ns_main_searchlist->r_list;
+	struct link_map **old = GL(dl_ns)[nsid]._ns_main_searchlist->r_list;
 
 	/* Put the old map in.  */
-	GL(dl_ns)[ns]._ns_main_searchlist->r_list
+	GL(dl_ns)[nsid]._ns_main_searchlist->r_list
 	  // XXX Check whether we need NS-specific initial_searchlist
 	  = GLRO(dl_initial_searchlist).r_list;
 	/* Signal that the original map is used.  */
-	GL(dl_ns)[ns]._ns_global_scope_alloc = 0;
+	GL(dl_ns)[nsid]._ns_global_scope_alloc = 0;
 
 	/* Now free the old map.  */
 	free (old);

Modified: trunk/libc/elf/dl-open.c
==============================================================================
--- trunk/libc/elf/dl-open.c (original)
+++ trunk/libc/elf/dl-open.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Load a shared object at runtime, relocate it, and run its initializer.
-   Copyright (C) 1996-2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2005, 2006, 2007 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,17 +97,17 @@
      in an realloc() call.  Therefore we allocate a completely new
      array the first time we have to add something to the locale scope.  */
 
-  if (GL(dl_ns)[new->l_ns]._ns_global_scope_alloc == 0)
+  struct link_namespaces *ns = &GL(dl_ns)[new->l_ns];
+  if (ns->_ns_global_scope_alloc == 0)
     {
       /* This is the first dynamic object given global scope.  */
-      GL(dl_ns)[new->l_ns]._ns_global_scope_alloc
-	= GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist + to_add + 8;
+      ns->_ns_global_scope_alloc
+	= ns->_ns_main_searchlist->r_nlist + to_add + 8;
       new_global = (struct link_map **)
-	malloc (GL(dl_ns)[new->l_ns]._ns_global_scope_alloc
-		* sizeof (struct link_map *));
+	malloc (ns->_ns_global_scope_alloc * sizeof (struct link_map *));
       if (new_global == NULL)
 	{
-	  GL(dl_ns)[new->l_ns]._ns_global_scope_alloc = 0;
+	  ns->_ns_global_scope_alloc = 0;
 	nomem:
 	  _dl_signal_error (ENOMEM, new->l_libname->name, NULL,
 			    N_("cannot extend global scope"));
@@ -115,29 +115,29 @@
 	}
 
       /* Copy over the old entries.  */
-      GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list
-	= memcpy (new_global,
-		  GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list,
-		  (GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist
+      ns->_ns_main_searchlist->r_list
+	= memcpy (new_global, ns->_ns_main_searchlist->r_list,
+		  (ns->_ns_main_searchlist->r_nlist
 		   * sizeof (struct link_map *)));
     }
-  else if (GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist + to_add
-	   > GL(dl_ns)[new->l_ns]._ns_global_scope_alloc)
+  else if (ns->_ns_main_searchlist->r_nlist + to_add
+	   > ns->_ns_global_scope_alloc)
     {
       /* We have to extend the existing array of link maps in the
 	 main map.  */
       new_global = (struct link_map **)
-	realloc (GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list,
-		 ((GL(dl_ns)[new->l_ns]._ns_global_scope_alloc + to_add + 8)
+	realloc (ns->_ns_main_searchlist->r_list,
+		 ((ns->_ns_global_scope_alloc + to_add + 8)
 		  * sizeof (struct link_map *)));
       if (new_global == NULL)
 	goto nomem;
 
-      GL(dl_ns)[new->l_ns]._ns_global_scope_alloc += to_add + 8;
-      GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list = new_global;
+      ns->_ns_global_scope_alloc += to_add + 8;
+      ns->_ns_main_searchlist->r_list = new_global;
     }
 
   /* Now add the new entries.  */
+  unsigned int new_nlist = ns->_ns_main_searchlist->r_nlist;
   for (cnt = 0; cnt < new->l_searchlist.r_nlist; ++cnt)
     {
       struct link_map *map = new->l_searchlist.r_list[cnt];
@@ -145,11 +145,11 @@
       if (map->l_global == 0)
 	{
 	  map->l_global = 1;
-	  GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_list[GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist]
-	    = map;
-	  ++GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist;
-	}
-    }
+	  ns->_ns_main_searchlist->r_list[new_nlist++] = map;
+	}
+    }
+  atomic_write_barrier ();
+  ns->_ns_main_searchlist->r_nlist = new_nlist;
 
   return 0;
 }

Modified: trunk/libc/include/features.h
==============================================================================
--- trunk/libc/include/features.h (original)
+++ trunk/libc/include/features.h Wed May 16 07:10:16 2007
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006
-	Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1993,1995-2006,2007 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
@@ -303,7 +302,7 @@
 /* Major and minor version number of the GNU C library package.  Use
    these macros to test for features in specific releases.  */
 #define	__GLIBC__	2
-#define	__GLIBC_MINOR__	5
+#define	__GLIBC_MINOR__	6
 
 #define __GLIBC_PREREQ(maj, min) \
 	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))

Modified: trunk/libc/include/link.h
==============================================================================
--- trunk/libc/include/link.h (original)
+++ trunk/libc/include/link.h Wed May 16 07:10:16 2007
@@ -1,6 +1,6 @@
 /* Data structure for communication from the run-time dynamic linker for
    loaded ELF shared objects.
-   Copyright (C) 1995-2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2006, 2007 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
@@ -140,6 +140,10 @@
 
     /* Dependent object that first caused this object to be loaded.  */
     struct link_map *l_loader;
+
+    /* Array with version names.  */
+    struct r_found_version *l_versions;
+    unsigned int l_nversions;
 
     /* Symbol hash table.  */
     Elf_Symndx l_nbuckets;
@@ -184,10 +188,6 @@
     unsigned int l_removed:1;	/* Nozero if the object cannot be used anymore
 				   since it is removed.  */
 
-    /* Array with version names.  */
-    unsigned int l_nversions;
-    struct r_found_version *l_versions;
-
     /* Collected information about own RPATH directories.  */
     struct r_search_path_struct l_rpath_dirs;
 

Modified: trunk/libc/include/sys/cdefs.h
==============================================================================
--- trunk/libc/include/sys/cdefs.h (original)
+++ trunk/libc/include/sys/cdefs.h Wed May 16 07:10:16 2007
@@ -1,6 +1,12 @@
 #ifndef _SYS_CDEFS_H
 
 #include <misc/sys/cdefs.h>
+
+/* The compiler will optimize based on the knowledge the parameter is
+   not NULL.  This will omit tests.  A robust implementation cannot allow
+   this so when compiling glibc itself we ignore this attribute.  */
+#undef __nonnull
+#define __nonnull(params)
 
 extern void __chk_fail (void) __attribute__ ((__noreturn__));
 libc_hidden_proto (__chk_fail)

Modified: trunk/libc/io/Makefile
==============================================================================
--- trunk/libc/io/Makefile (original)
+++ trunk/libc/io/Makefile Wed May 16 07:10:16 2007
@@ -51,7 +51,8 @@
 	ftw ftw64 fts poll ppoll					\
 	posix_fadvise posix_fadvise64					\
 	posix_fallocate posix_fallocate64				\
-	sendfile sendfile64
+	sendfile sendfile64 \
+	utimensat futimens
 
 # These routines will be omitted from the libc shared object.
 # Instead the static object files will be included in a special archive

Modified: trunk/libc/io/Versions
==============================================================================
--- trunk/libc/io/Versions (original)
+++ trunk/libc/io/Versions Wed May 16 07:10:16 2007
@@ -113,4 +113,7 @@
 
     ppoll;
   }
+  GLIBC_2.6 {
+    utimensat; futimens;
+  }
 }

Modified: trunk/libc/io/sys/stat.h
==============================================================================
--- trunk/libc/io/sys/stat.h (original)
+++ trunk/libc/io/sys/stat.h Wed May 16 07:10:16 2007
@@ -28,11 +28,12 @@
 
 #include <bits/types.h>		/* For __mode_t and __dev_t.  */
 
-#if defined __USE_XOPEN || defined __USE_MISC
+#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_MISC \
+         || defined __USE_ATFILE
 # if defined __USE_XOPEN || defined __USE_XOPEN2K
 #  define __need_time_t
 # endif
-# ifdef __USE_MISC
+# if defined __USE_MISC || defined __USE_ATFILE
 #  define __need_timespec
 # endif
 # include <time.h>		/* For time_t resp. timespec.  */
@@ -352,6 +353,21 @@
    with FD.  */
 extern int mkfifoat (int __fd, __const char *__path, __mode_t __mode)
      __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_ATFILE
+/* Set file access and modification times relative to directory file
+   descriptor.  */
+extern int utimensat (int __fd, __const char *__path,
+		      __const struct timespec __times[2],
+		      int __flags)
+     __THROW __nonnull ((2));
+#endif
+
+#ifdef __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+/* Set file access and modification times of the file associated with FD.  */
+extern int futimens (int __fd, __const struct timespec __times[2]) __THROW;
 #endif
 
 /* To allow the `struct stat' structure and the file type `mode_t'

Modified: trunk/libc/locale/programs/linereader.c
==============================================================================
--- trunk/libc/locale/programs/linereader.c (original)
+++ trunk/libc/locale/programs/linereader.c Wed May 16 07:10:16 2007
@@ -523,8 +523,8 @@
     {
       lr->token.tok = tok_bsymbol;
 
+      buf = xrealloc (buf, bufact + 1);
       buf[bufact] = '\0';
-      buf = xrealloc (buf, bufact + 1);
 
       lr->token.val.str.startmb = buf;
       lr->token.val.str.lenmb = bufact - 1;
@@ -576,8 +576,8 @@
     {
       lr->token.tok = tok_ident;
 
+      buf = xrealloc (buf, bufact + 1);
       buf[bufact] = '\0';
-      buf = xrealloc (buf, bufact + 1);
 
       lr->token.val.str.startmb = buf;
       lr->token.val.str.lenmb = bufact;

Modified: trunk/libc/localedata/ChangeLog
==============================================================================
--- trunk/libc/localedata/ChangeLog (original)
+++ trunk/libc/localedata/ChangeLog Wed May 16 07:10:16 2007
@@ -1,3 +1,16 @@
+2007-05-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* locales/as_IN: Fix currency_symbol, abday for Sunday, abmon for
+	January, February, and September to December, mon for January,
+	February, September, and December, am_pm, and name_*.
+	Patch by Amitakhya Phukan <aphukan@xxxxxxxxxx>.
+
+2007-05-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4114]
+	* locales/ast_ES: New file.
+	* SUPPORTED (SUPPORTED-LOCALES): Add ast_ES.UTF-8 and ast_ES.
+
 2007-04-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #4024]

Modified: trunk/libc/localedata/SUPPORTED
==============================================================================
--- trunk/libc/localedata/SUPPORTED (original)
+++ trunk/libc/localedata/SUPPORTED Wed May 16 07:10:16 2007
@@ -48,6 +48,8 @@
 ar_YE/ISO-8859-6 \
 az_AZ.UTF-8/UTF-8 \
 as_IN.UTF-8/UTF-8 \
+ast_ES.UTF-8/UTF-8 \
+ast_ES/ISO-8859-15 \
 be_BY.UTF-8/UTF-8 \
 be_BY/CP1251 \
 be_BY@latin/UTF-8 \

Modified: trunk/libc/localedata/locales/as_IN
==============================================================================
--- trunk/libc/localedata/locales/as_IN (original)
+++ trunk/libc/localedata/locales/as_IN Wed May 16 07:10:16 2007
@@ -610,7 +610,7 @@
 %%%%%%%%%%%%%
 LC_MONETARY
 int_curr_symbol       "<U0049><U004E><U0052><U0020>"
-currency_symbol       "<U0052><U0073><U002E>"
+currency_symbol       "<U099F><U0995><U09BE>"
 mon_decimal_point     "<U002E>"
 mon_thousands_sep     "<U002C>"
 mon_grouping          3;2
@@ -634,7 +634,7 @@
 
 %%%%%%%%%%%%%
 LC_TIME
-abday   "<U09F0><U09AC><U09BF>";/
+abday   "<U09A6><U09C7><U0993>";/
         "<U09B8><U09CB><U09AE>";/
         "<U09AE><U0999><U09CD><U0997><U09B2>";/
         "<U09AC><U09C1><U09A7>";/
@@ -648,37 +648,37 @@
         "<U09AC><U09C3><U09B9><U09B7><U09CD><U09AA><U09A4><U09BF><U09AC><U09BE><U09F0>";/
         "<U09B6><U09C1><U0995><U09CD><U09F0><U09AC><U09BE><U09F0>";/
         "<U09B6><U09A8><U09BF><U09AC><U09BE><U09F0>"
-abmon   "<U099C><U09BE><U09A8><U09C1>";/
-        "<U09AB><U09C7><U09AC><U09CD><U09F0><U09C1>";/
+abmon   "<U099C><U09BE><U09A8><U09C1><U09F1><U09BE><U09F0><U09C0>";/
+        "<U09AB><U09C7><U09AC><U09CD><U09F0><U09C1><U09F1><U09BE><U09F0><U09C0>";/
         "<U09AE><U09BE><U09F0><U09CD><U099A>";/
         "<U098F><U09AA><U09CD><U09F0><U09BF><U09B2>";/
         "<U09AE><U09C7>";/
         "<U099C><U09C1><U09A8>";/
         "<U099C><U09C1><U09B2><U09BE><U0987>";/
         "<U0986><U0997>";/
-        "<U09B8><U09C7><U09AA><U09CD><U099F>";/
-        "<U0985><U0995><U09CD><U099F><U09CB>";/
-        "<U09A8><U09AD><U09C7>";/
-        "<U09A1><U09BF><U09B8><U09C7>"
-mon     "<U099C><U09BE><U09A8><U09C1><U09DF><U09BE><U09F0><U09C0>";/
-        "<U09AB><U09C7><U09AC><U09CD><U09F0><U09C1><U09DF><U09BE><U09F0><U09C0>";/
+        "<U099A><U09C7><U09AA><U09CD><U09A4><U09C7><U09AE><U09CD><U09AC><U09F0>";/
+        "<U0985><U0995><U09CD><U099F><U09CB><U09AC><U09F0>";/
+        "<U09A8><U09AD><U09C7><U09AE><U09CD><U09AC><U09F0>";/
+        "<U09A1><U09BF><U099A><U09C7><U09AE><U09CD><U09AC><U09F0>"
+mon     "<U099C><U09BE><U09A8><U09C1><U09F1><U09BE><U09F0><U09C0>";/
+        "<U09AB><U09C7><U09AC><U09CD><U09F0><U09C1><U09F1><U09BE><U09F0><U09C0>";/
         "<U09AE><U09BE><U09F0><U09CD><U099A>";/
         "<U098F><U09AA><U09CD><U09F0><U09BF><U09B2>";/
         "<U09AE><U09C7>";/
         "<U099C><U09C1><U09A8>";/
         "<U099C><U09C1><U09B2><U09BE><U0987>";/
         "<U0986><U0997><U09B7><U09CD><U099F>";/
-        "<U09B8><U09C7><U09AA><U09CD><U099F><U09C7><U09AE><U09CD><U09AC><U09F0>";/
+        "<U099A><U09C7><U09AA><U09CD><U09A4><U09C7><U09AE><U09CD><U09AC><U09F0>";/
         "<U0985><U0995><U09CD><U099F><U09CB><U09AC><U09F0>";/
         "<U09A8><U09AD><U09C7><U09AE><U09CD><U09AC><U09F0>";/
-        "<U09A1><U09BF><U09B8><U09C7><U09AE><U09CD><U09AC><U09F0>"
+        "<U09A1><U09BF><U099A><U09C7><U09AE><U09CD><U09AC><U09F0>"
 % d_fmt  "%e-%m-%Y"
 d_fmt    "<U0025><U0065><U002D><U0025><U006D><U002D><U0025><U0059>"
 % t_fmt  "%I.%M.%S %p"
 t_fmt    "<U0025><U0049><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U0070>"
 % d_t_fmt"%e %B, %Y %I.%M.%S %p %Z"
 d_t_fmt  "<U0025><U0065><U0020><U0025><U0042><U002C><U0020><U0025><U0059><U0020><U0025><U0049><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U0070><U0020><U0025><U005A>"
-am_pm    "<U09AA><U09C2><U09F0><U09CD><U09AC><U09BE>";"<U0985><U09AA>"
+am_pm    "<U09AA><U09C2><U09F0><U09CD><U09AC><U09CD><U09AC><U09BE><U09B9><U09CD><U09A8>";"<U0985><U09AA><U09F0><U09BE><U09B9><U09CD><U09A8>"  
 % t_fmt_ampm  "%I.%M.%S %p"
 t_fmt_ampm  "<U0025><U0049><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U0070>"
 END LC_TIME
@@ -704,10 +704,10 @@
 name_fmt    "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
 <U0025><U0067>"
 name_gen    ""
-name_mr     "<U004D><U0072><U002E>"
-name_mrs    "<U004D><U0072><U0073><U002E>"
-name_miss   "<U004D><U0069><U0073><U0073><U002E>"
-name_ms     "<U004D><U0073><U002E>"
+name_mr     "<U09B6><U09CD><U09F0><U09C0>"
+name_mrs    "<U09B6><U09CD><U09F0><U09C0><U09AE><U09A4><U09C0>"
+name_miss   "<U0995><U09C1><U09AE><U09BE><U09F0><U09C0>"
+name_ms     "<U0995><U09C1><U09AE><U09BE><U09F0><U09C0>"
 END LC_NAME
 
 %%%%%%%%%%%%%

Modified: trunk/libc/malloc/Makefile
==============================================================================
--- trunk/libc/malloc/Makefile (original)
+++ trunk/libc/malloc/Makefile Wed May 16 07:10:16 2007
@@ -104,6 +104,7 @@
 include ../Rules
 
 CFLAGS-mcheck-init.c = $(PIC-ccflag)
+CFLAGS-malloc.c += -DMALLOC_DEBUG
 
 $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
 	-rm -f $@

Modified: trunk/libc/malloc/arena.c
==============================================================================
--- trunk/libc/malloc/arena.c (original)
+++ trunk/libc/malloc/arena.c Wed May 16 07:10:16 2007
@@ -1,5 +1,6 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2003,2004,2005,2006,2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@xxxxxxxxx>, 2001.
 
@@ -59,10 +60,12 @@
   mstate ar_ptr; /* Arena for this heap. */
   struct _heap_info *prev; /* Previous heap. */
   size_t size;   /* Current size in bytes. */
+  size_t mprotect_size;	/* Size in bytes that has been mprotected
+			   PROT_READ|PROT_WRITE.  */
   /* Make sure the following data is properly aligned, particularly
      that sizeof (heap_info) + 2 * SIZE_SZ is a multiple of
-     MALLOG_ALIGNMENT. */
-  char pad[-5 * SIZE_SZ & MALLOC_ALIGN_MASK];
+     MALLOC_ALIGNMENT. */
+  char pad[-6 * SIZE_SZ & MALLOC_ALIGN_MASK];
 } heap_info;
 
 /* Get a compile-time error if the heap_info padding is not correct
@@ -367,6 +370,9 @@
   mp_.top_pad        = DEFAULT_TOP_PAD;
 #endif
   mp_.n_mmaps_max    = DEFAULT_MMAP_MAX;
+#if MALLOC_DEBUG
+  mp_.n_mmaps_cmax   = DEFAULT_MMAP_MAX;
+#endif
   mp_.mmap_threshold = DEFAULT_MMAP_THRESHOLD;
   mp_.trim_threshold = DEFAULT_TRIM_THRESHOLD;
   mp_.pagesize       = malloc_getpagesize;
@@ -692,6 +698,7 @@
   }
   h = (heap_info *)p2;
   h->size = size;
+  h->mprotect_size = size;
   THREAD_STAT(stat_n_heaps++);
   return h;
 }
@@ -714,17 +721,34 @@
     new_size = (long)h->size + diff;
     if((unsigned long) new_size > (unsigned long) HEAP_MAX_SIZE)
       return -1;
-    if(mprotect((char *)h + h->size, diff, PROT_READ|PROT_WRITE) != 0)
-      return -2;
+    if((unsigned long) new_size > h->mprotect_size) {
+      if (mprotect((char *)h + h->mprotect_size,
+		   (unsigned long) new_size - h->mprotect_size,
+		   PROT_READ|PROT_WRITE) != 0)
+	return -2;
+      h->mprotect_size = new_size;
+    }
   } else {
     new_size = (long)h->size + diff;
     if(new_size < (long)sizeof(*h))
       return -1;
     /* Try to re-map the extra heap space freshly to save memory, and
        make it inaccessible. */
-    if((char *)MMAP((char *)h + new_size, -diff, PROT_NONE,
-                    MAP_PRIVATE|MAP_FIXED) == (char *) MAP_FAILED)
-      return -2;
+#ifdef _LIBC
+    if (__builtin_expect (__libc_enable_secure, 0))
+#else
+    if (1)
+#endif
+      {
+	if((char *)MMAP((char *)h + new_size, -diff, PROT_NONE,
+			MAP_PRIVATE|MAP_FIXED) == (char *) MAP_FAILED)
+	  return -2;
+	h->mprotect_size = new_size;
+      }
+#ifdef _LIBC
+    else
+      madvise ((char *)h + new_size, -diff, MADV_DONTNEED);
+#endif
     /*fprintf(stderr, "shrink %p %08lx\n", h, new_size);*/
   }
   h->size = new_size;

Modified: trunk/libc/malloc/hooks.c
==============================================================================
--- trunk/libc/malloc/hooks.c (original)
+++ trunk/libc/malloc/hooks.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Malloc implementation for multiple threads without lock contention.
-   Copyright (C) 2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+   Copyright (C) 2001-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Wolfram Gloger <wg@xxxxxxxxx>, 2001.
 
@@ -507,6 +507,9 @@
   unsigned long trim_threshold;
   unsigned long top_pad;
   unsigned int  n_mmaps_max;
+#if MALLOC_DEBUG
+  unsigned int  n_mmaps_cmax;
+#endif
   unsigned long mmap_threshold;
   int           check_action;
   unsigned long max_sbrked_mem;
@@ -550,6 +553,9 @@
   ms->trim_threshold = mp_.trim_threshold;
   ms->top_pad = mp_.top_pad;
   ms->n_mmaps_max = mp_.n_mmaps_max;
+#if MALLOC_DEBUG
+  ms->n_mmaps_cmax = mp_.n_mmaps_cmax;
+#endif
   ms->mmap_threshold = mp_.mmap_threshold;
   ms->check_action = check_action;
   ms->max_sbrked_mem = main_arena.max_system_mem;
@@ -621,6 +627,9 @@
   mp_.trim_threshold = ms->trim_threshold;
   mp_.top_pad = ms->top_pad;
   mp_.n_mmaps_max = ms->n_mmaps_max;
+#if MALLOC_DEBUG
+  mp_.n_mmaps_cmax = ms->n_mmaps_cmax;
+#endif
   mp_.mmap_threshold = ms->mmap_threshold;
   check_action = ms->check_action;
   main_arena.max_system_mem = ms->max_sbrked_mem;

Modified: trunk/libc/malloc/malloc.c
==============================================================================
--- trunk/libc/malloc/malloc.c (original)
+++ trunk/libc/malloc/malloc.c Wed May 16 07:10:16 2007
@@ -2125,21 +2125,36 @@
 
 #define NBINS             128
 #define NSMALLBINS         64
-#define SMALLBIN_WIDTH      8
-#define MIN_LARGE_SIZE    512
+#define SMALLBIN_WIDTH    MALLOC_ALIGNMENT
+#define MIN_LARGE_SIZE    (NSMALLBINS * SMALLBIN_WIDTH)
 
 #define in_smallbin_range(sz)  \
   ((unsigned long)(sz) < (unsigned long)MIN_LARGE_SIZE)
 
-#define smallbin_index(sz)     (((unsigned)(sz)) >> 3)
-
-#define largebin_index(sz)                                                   \
-(((((unsigned long)(sz)) >>  6) <= 32)?  56 + (((unsigned long)(sz)) >>  6): \
+#define smallbin_index(sz) \
+  (SMALLBIN_WIDTH == 16 ? (((unsigned)(sz)) >> 4) : (((unsigned)(sz)) >> 3))
+
+#define largebin_index_32(sz)                                                \
+(((((unsigned long)(sz)) >>  6) <= 38)?  56 + (((unsigned long)(sz)) >>  6): \
  ((((unsigned long)(sz)) >>  9) <= 20)?  91 + (((unsigned long)(sz)) >>  9): \
  ((((unsigned long)(sz)) >> 12) <= 10)? 110 + (((unsigned long)(sz)) >> 12): \
  ((((unsigned long)(sz)) >> 15) <=  4)? 119 + (((unsigned long)(sz)) >> 15): \
  ((((unsigned long)(sz)) >> 18) <=  2)? 124 + (((unsigned long)(sz)) >> 18): \
                                         126)
+
+// XXX It remains to be seen whether it is good to keep the widths of
+// XXX the buckets the same or whether it should be scaled by a factor
+// XXX of two as well.
+#define largebin_index_64(sz)                                                \
+(((((unsigned long)(sz)) >>  6) <= 48)?  48 + (((unsigned long)(sz)) >>  6): \
+ ((((unsigned long)(sz)) >>  9) <= 20)?  91 + (((unsigned long)(sz)) >>  9): \
+ ((((unsigned long)(sz)) >> 12) <= 10)? 110 + (((unsigned long)(sz)) >> 12): \
+ ((((unsigned long)(sz)) >> 15) <=  4)? 119 + (((unsigned long)(sz)) >> 15): \
+ ((((unsigned long)(sz)) >> 18) <=  2)? 124 + (((unsigned long)(sz)) >> 18): \
+                                        126)
+
+#define largebin_index(sz) \
+  (SIZE_SZ == 8 ? largebin_index_64 (sz) : largebin_index_32 (sz))
 
 #define bin_index(sz) \
  ((in_smallbin_range(sz)) ? smallbin_index(sz) : largebin_index(sz))
@@ -2343,6 +2358,9 @@
   /* Memory map support */
   int              n_mmaps;
   int              n_mmaps_max;
+#if MALLOC_DEBUG
+  int              n_mmaps_cmax;
+#endif
   int              max_n_mmaps;
   /* the mmap_threshold is dynamic, until the user sets
      it manually, at which point we need to disable any
@@ -2858,7 +2876,8 @@
   assert(total <= (unsigned long)(mp_.max_total_mem));
   assert(mp_.n_mmaps >= 0);
 #endif
-  assert(mp_.n_mmaps <= mp_.n_mmaps_max);
+  assert(mp_.n_mmaps <= mp_.n_mmaps_cmax);
+  assert(mp_.n_mmaps_max <= mp_.n_mmaps_cmax);
   assert(mp_.n_mmaps <= mp_.max_n_mmaps);
 
   assert((unsigned long)(av->system_mem) <=
@@ -3456,6 +3475,13 @@
     }
 
   mp_.n_mmaps--;
+#if MALLOC_DEBUG
+  if (mp_.n_mmaps_cmax > mp_.n_mmaps_max)
+    {
+      assert (mp_.n_mmaps_cmax == mp_.n_mmaps + 1);
+      mp_.n_mmaps_cmax = mp_.n_mmaps;
+    }
+#endif
   mp_.mmapped_mem -= total_size;
 
   int ret __attribute__ ((unused)) = munmap((char *)block, total_size);
@@ -5371,6 +5397,9 @@
   mp_.n_mmaps_max = 0;
   mem = _int_malloc(av, size);
   mp_.n_mmaps_max = mmx;   /* reset mmap */
+#if MALLOC_DEBUG
+  mp_.n_mmaps_cmax = mmx;
+#endif
   if (mem == 0)
     return 0;
 
@@ -5696,8 +5725,17 @@
       res = 0;
     else
 #endif
-      mp_.n_mmaps_max = value;
-      mp_.no_dyn_threshold = 1;
+      {
+#if MALLOC_DEBUG
+	if (mp_.n_mmaps <= value)
+	  mp_.n_mmaps_cmax = value;
+	else
+	  mp_.n_mmaps_cmax = mp_.n_mmaps;
+#endif
+
+	mp_.n_mmaps_max = value;
+	mp_.no_dyn_threshold = 1;
+      }
     break;
 
   case M_CHECK_ACTION:

Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Wed May 16 07:10:16 2007
@@ -1,3 +1,48 @@
+2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary
+	extra cancellation test.
+	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
+
+2007-05-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* descr.h (struct pthread): Rearrange members to fill hole in
+	64-bit layout.
+
+	* sysdeps/unix/sysv/linux/pthread_setaffinity.c
+	(__pthread_setaffinity_new): If syscall was successful and
+	RESET_VGETCPU_CACHE is defined, use it before returning.
+	* sysdeps/unix/sysv/linux/x86_64/pthread_setaffinity.c: New file.
+
+2007-05-10  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #4455]
+	* tst-align2.c: Include stackinfo.h.
+	* tst-getpid1.c: Likewise.
+
+2007-05-02  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	[BZ #4455]
+	* tst-align2.c (do_test): Add _STACK_GROWS_UP case.
+	* tst-getpid1.c (do_test): Likewise.
+
+	[BZ #4456]
+	* allocatestack.c (change_stack_perm): Add _STACK_GROWS_UP case.
+	(allocate_stack): Likewise.
+
+2007-05-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/lowlevelrobustlock.c
+	(__lll_robust_lock_wait): Fix race caused by reloading of futex value.
+	(__lll_robust_timedlock_wait): Likewise.
+	Reported by Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>.
+
+2007-05-06  Mike Frysinger  <vapier@xxxxxxxxxx>
+
+	[BZ #4465]
+	* tst-cancel-wrappers.sh: Set C["fdatasync"] to 1.
+	* tst-cancel4.c (tf_fdatasync): New test.
+
 2007-04-27  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #4392]

Modified: trunk/libc/nptl/TODO
==============================================================================
--- trunk/libc/nptl/TODO (original)
+++ trunk/libc/nptl/TODO Wed May 16 07:10:16 2007
@@ -14,3 +14,18 @@
 
 - test with threaded process terminating and semadj (?) being applied
   only after all threads are gone
+
+
+
+- semaphore changes:
+
+  - sem_post should only wake one thread and only when the state of
+    the semaphore changed from 0 to 1
+
+    this also requires that sem_wait and sem_timedwait don't drop the
+    post if they get canceled.
+
+  - possibly add counter field.  This requires reviving the
+    differences between old and new semaphose funtions.  The old ones
+    stay as they are now.  The new once can use an additional field
+    wich is the counter for the number of waiters

Modified: trunk/libc/nptl/allocatestack.c
==============================================================================
--- trunk/libc/nptl/allocatestack.c (original)
+++ trunk/libc/nptl/allocatestack.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -288,9 +288,14 @@
 		 + (((((pd->stackblock_size - pd->guardsize) / 2)
 		      & pagemask) + pd->guardsize) & pagemask));
   size_t len = pd->stackblock + pd->stackblock_size - stack;
-#else
+#elif _STACK_GROWS_DOWN
   void *stack = pd->stackblock + pd->guardsize;
   size_t len = pd->stackblock_size - pd->guardsize;
+#elif _STACK_GROWS_UP
+  void *stack = pd->stackblock;
+  size_t len = (uintptr_t) pd - pd->guardsize - (uintptr_t) pd->stackblock;
+#else
+# error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
 #endif
   if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
     return errno;
@@ -570,8 +575,10 @@
 	{
 #ifdef NEED_SEPARATE_REGISTER_STACK
 	  char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
-#else
+#elif _STACK_GROWS_DOWN
 	  char *guard = mem;
+# elif _STACK_GROWS_UP
+	  char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
 #endif
 	  if (mprotect (guard, guardsize, PROT_NONE) != 0)
 	    {
@@ -618,9 +625,13 @@
 			oldguard + pd->guardsize - guard - guardsize,
 			prot) != 0)
 	    goto mprot_error;
-#else
+#elif _STACK_GROWS_DOWN
 	  if (mprotect ((char *) mem + guardsize, pd->guardsize - guardsize,
 			prot) != 0)
+	    goto mprot_error;
+#elif _STACK_GROWS_UP
+	  if (mprotect ((char *) pd - pd->guardsize,
+			pd->guardsize - guardsize, prot) != 0)
 	    goto mprot_error;
 #endif
 
@@ -661,8 +672,11 @@
 #ifdef NEED_SEPARATE_REGISTER_STACK
   *stack = pd->stackblock;
   *stacksize = stacktop - *stack;
-#else
+#elif _STACK_GROWS_DOWN
   *stack = stacktop;
+#elif _STACK_GROWS_UP
+  *stack = pd->stackblock;
+  assert (*stack > 0);
 #endif
 
   return 0;

Modified: trunk/libc/nptl/descr.h
==============================================================================
--- trunk/libc/nptl/descr.h (original)
+++ trunk/libc/nptl/descr.h Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -268,6 +268,9 @@
 	       | EXITING_BITMASK | CANCEL_RESTMASK | TERMINATED_BITMASK))     \
    == (CANCELTYPE_BITMASK | CANCELED_BITMASK))
 
+  /* Flags.  Including those copied from the thread attribute.  */
+  int flags;
+
   /* We allocate one block of references here.  This should be enough
      to avoid allocating any memory dynamically for most applications.  */
   struct pthread_key_data
@@ -320,9 +323,6 @@
   struct pthread *joinid;
   /* Check whether a thread is detached.  */
 #define IS_DETACHED(pd) ((pd)->joinid == (pd))
-
-  /* Flags.  Including those copied from the thread attribute.  */
-  int flags;
 
   /* The result of the thread function.  */
   void *result;

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/lowlevelrobustlock.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2006.
 
@@ -30,6 +30,10 @@
   int oldval = *futex;
   int tid = THREAD_GETMEM (THREAD_SELF, tid);
 
+  /* If the futex changed meanwhile try locking again.  */
+  if (oldval == 0)
+    goto try;
+
   do
     {
       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
@@ -41,6 +45,9 @@
 	continue;
 
       lll_futex_wait (futex, newval);
+
+    try:
+      ;
     }
   while ((oldval = atomic_compare_and_exchange_val_acq (futex,
 							tid | FUTEX_WAITERS,
@@ -57,6 +64,11 @@
     return EINVAL;
 
   int tid = THREAD_GETMEM (THREAD_SELF, tid);
+  int oldval = *futex;
+
+  /* If the futex changed meanwhile try locking again.  */
+  if (oldval == 0)
+    goto try;
 
   do
     {
@@ -80,7 +92,6 @@
 	return ETIMEDOUT;
 
       /* Wait.  */
-      int oldval = *futex;
       if (__builtin_expect (oldval & FUTEX_OWNER_DIED, 0))
 	return oldval;
 
@@ -90,8 +101,13 @@
 	continue;
 
       lll_futex_timed_wait (futex, newval, &rt);
+
+    try:
+      ;
     }
-  while (atomic_compare_and_exchange_bool_acq (futex, tid | FUTEX_WAITERS, 0));
+  while ((oldval = atomic_compare_and_exchange_val_acq (futex,
+							tid | FUTEX_WAITERS,
+							0)) != 0);
 
   return 0;
 }

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2003.
 
@@ -79,6 +79,12 @@
 
   res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, cpusetsize,
 			  cpuset);
+
+#ifdef RESET_VGETCPU_CACHE
+  if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+    RESET_VGETCPU_CACHE ();
+#endif
+
   return (INTERNAL_SYSCALL_ERROR_P (res, err)
 	  ? INTERNAL_SYSCALL_ERRNO (res, err)
 	  : 0);

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -40,12 +40,6 @@
 	.align	16
 	cfi_startproc
 sem_timedwait:
-	/* First check for cancellation.  */
-	movl	%fs:CANCELHANDLING, %eax
-	andl	$0xfffffff9, %eax
-	cmpl	$8, %eax
-	je	11f
-
 	movl	(%rdi), %eax
 2:	testl	%eax, %eax
 	je	1f
@@ -160,16 +154,5 @@
 
 	orl	$-1, %eax
 	jmp	10b
-	cfi_adjust_cfa_offset(-48)
-	cfi_restore(14)
-	cfi_restore(13)
-	cfi_restore(12)
-
-11:	/* Canceled.  */
-	movq	$0xffffffffffffffff, %fs:RESULT
-	LOCK
-	orl	$0x10, %fs:CANCELHANDLING
-	movq	%fs:CLEANUP_JMP_BUF, %rdi
-	jmp	HIDDEN_JUMPTARGET (__pthread_unwind)
 	cfi_endproc
 	.size	sem_timedwait,.-sem_timedwait

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -37,12 +37,6 @@
 	.align	16
 	cfi_startproc
 sem_wait:
-	/* First check for cancellation.  */
-	movl	%fs:CANCELHANDLING, %eax
-	andl	$0xfffffff9, %eax
-	cmpl	$8, %eax
-	je	4f
-
 	pushq	%r12
 	cfi_adjust_cfa_offset(8)
 	cfi_offset(12, -16)
@@ -109,12 +103,5 @@
 	cfi_restore(12)
 
 	retq
-
-4:	/* Canceled.  */
-	movq	$0xffffffffffffffff, %fs:RESULT
-	LOCK
-	orl	$0x10, %fs:CANCELHANDLING
-	movq	%fs:CLEANUP_JMP_BUF, %rdi
-	jmp	HIDDEN_JUMPTARGET (__pthread_unwind)
 	cfi_endproc
 	.size	sem_wait,.-sem_wait

Modified: trunk/libc/nptl/tst-align2.c
==============================================================================
--- trunk/libc/nptl/tst-align2.c (original)
+++ trunk/libc/nptl/tst-align2.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2007 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
@@ -24,6 +24,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 #include <tst-stack-align.h>
+#include <stackinfo.h>
 
 static int
 f (void *arg)
@@ -53,8 +54,14 @@
   char st[256 * 1024];
   pid_t p = __clone2 (f, st, sizeof (st), 0, 0);
 #else
-  char st[128 * 1024];
+  char st[128 * 1024] __attribute__ ((aligned));
+# if _STACK_GROWS_DOWN
   pid_t p = clone (f, st + sizeof (st), 0, 0);
+# elif _STACK_GROWS_UP
+  pid_t p = clone (f, st, 0, 0);
+# else
+#  error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+# endif
 #endif
   if (p == -1)
     {

Modified: trunk/libc/nptl/tst-cancel-wrappers.sh
==============================================================================
--- trunk/libc/nptl/tst-cancel-wrappers.sh (original)
+++ trunk/libc/nptl/tst-cancel-wrappers.sh Wed May 16 07:10:16 2007
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Test whether all cancelable functions are cancelable.
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2002.
 
@@ -27,6 +27,7 @@
 C["connect"]=1
 C["creat"]=1
 C["fcntl"]=1
+C["fdatasync"]=1
 C["fsync"]=1
 C["msgrcv"]=1
 C["msgsnd"]=1

Modified: trunk/libc/nptl/tst-cancel4.c
==============================================================================
--- trunk/libc/nptl/tst-cancel4.c (original)
+++ trunk/libc/nptl/tst-cancel4.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -1565,6 +1565,47 @@
   pthread_cleanup_pop (0);
 
   printf ("%s: fsync returned\n", __FUNCTION__);
+
+  exit (1);
+}
+
+
+static void *
+tf_fdatasync (void *arg)
+{
+  if (arg == NULL)
+    // XXX If somebody can provide a portable test case in which fdatasync()
+    // blocks we can enable this test to run in both rounds.
+    abort ();
+
+  tempfd = open ("Makefile", O_RDONLY);
+  if (tempfd == -1)
+    {
+      printf ("%s: cannot open Makefile\n", __FUNCTION__);
+      exit (1);
+    }
+
+  int r = pthread_barrier_wait (&b2);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      printf ("%s: barrier_wait failed\n", __FUNCTION__);
+      exit (1);
+    }
+
+  r = pthread_barrier_wait (&b2);
+  if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
+    {
+      printf ("%s: 2nd barrier_wait failed\n", __FUNCTION__);
+      exit (1);
+    }
+
+  pthread_cleanup_push (cl, NULL);
+
+  fdatasync (tempfd);
+
+  pthread_cleanup_pop (0);
+
+  printf ("%s: fdatasync returned\n", __FUNCTION__);
 
   exit (1);
 }
@@ -2078,6 +2119,7 @@
   ADD_TEST (pread, 2, 1),
   ADD_TEST (pwrite, 2, 1),
   ADD_TEST (fsync, 2, 1),
+  ADD_TEST (fdatasync, 2, 1),
   ADD_TEST (msync, 2, 1),
   ADD_TEST (sendto, 2, 1),
   ADD_TEST (sendmsg, 2, 1),

Modified: trunk/libc/nptl/tst-getpid1.c
==============================================================================
--- trunk/libc/nptl/tst-getpid1.c (original)
+++ trunk/libc/nptl/tst-getpid1.c Wed May 16 07:10:16 2007
@@ -5,6 +5,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <stackinfo.h>
 
 #ifndef TEST_CLONE_FLAGS
 #define TEST_CLONE_FLAGS 0
@@ -48,7 +49,13 @@
   pid_t p = __clone2 (f, st, sizeof (st), TEST_CLONE_FLAGS, 0);
 #else
   char st[128 * 1024] __attribute__ ((aligned));
+# if _STACK_GROWS_DOWN
   pid_t p = clone (f, st + sizeof (st), TEST_CLONE_FLAGS, 0);
+# elif _STACK_GROWS_UP
+  pid_t p = clone (f, st, TEST_CLONE_FLAGS, 0);
+# else
+#  error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
+# endif
 #endif
   if (p == -1)
     {

Modified: trunk/libc/posix/unistd.h
==============================================================================
--- trunk/libc/posix/unistd.h (original)
+++ trunk/libc/posix/unistd.h Wed May 16 07:10:16 2007
@@ -1062,7 +1062,7 @@
 #if defined __USE_POSIX199309 || defined __USE_UNIX98
 /* Synchronize at least the data part of a file with the underlying
    media.  */
-extern int fdatasync (int __fildes) __THROW;
+extern int fdatasync (int __fildes);
 #endif /* Use POSIX199309 */
 
 

Modified: trunk/libc/scripts/check-c++-types.sh
==============================================================================
--- trunk/libc/scripts/check-c++-types.sh (original)
+++ trunk/libc/scripts/check-c++-types.sh Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 #! /bin/bash
-# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2006, 2007 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
@@ -32,7 +32,7 @@
 #
 data=$1
 shift
-cxx="$*"
+cxx=$(echo $* | sed 's/-fgnu89-inline//')
 while read t; do
   echo -n "$t:"
   $cxx -S -xc++ -o - -D_GNU_SOURCE <(cat <<EOF

Modified: trunk/libc/stdio-common/vfprintf.c
==============================================================================
--- trunk/libc/stdio-common/vfprintf.c (original)
+++ trunk/libc/stdio-common/vfprintf.c Wed May 16 07:10:16 2007
@@ -1026,10 +1026,11 @@
 	    const char *mbs = (const char *) string;			      \
 	    mbstate_t mbstate;						      \
 									      \
-	    len = prec != -1 ? (size_t) prec : strlen (mbs);		      \
+	    len = prec != -1 ? __strnlen (mbs, (size_t) prec) : strlen (mbs); \
 									      \
 	    /* Allocate dynamically an array which definitely is long	      \
-	       enough for the wide character version.  */		      \
+	       enough for the wide character version.  Each byte in the	      \
+	       multi-byte string can produce at most one wide character.  */  \
 	    if (__libc_use_alloca (len * sizeof (wchar_t)))		      \
 	      string = (CHAR_T *) alloca (len * sizeof (wchar_t));	      \
 	    else if ((string = (CHAR_T *) malloc (len * sizeof (wchar_t)))    \
@@ -1173,8 +1174,8 @@
 		    memset (&ps, '\0', sizeof (ps));			      \
 									      \
 		    while (str2 != NULL && str2 < strend)		      \
-		      if (__mbsnrtowcs (ignore, &str2, strend - str2, 1024,   \
-					&ps) == (size_t) -1)		      \
+		      if (__mbsnrtowcs (ignore, &str2, strend - str2,	      \
+					ignore_size, &ps) == (size_t) -1)     \
 			{						      \
 			  done = -1;					      \
 			  goto all_done;				      \

Modified: trunk/libc/string/strfry.c
==============================================================================
--- trunk/libc/string/strfry.c (original)
+++ trunk/libc/string/strfry.c Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1996, 1999, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1996, 1999, 2002, 2007 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
@@ -37,16 +37,14 @@
       init = 1;
     }
 
-  len = strlen (string);
+  len = strlen (string) - 1;
   for (i = 0; i < len; ++i)
     {
       int32_t j;
-      char c;
+      __random_r (&rdata, &j);
+      j = j % len + 1;
 
-      __random_r (&rdata, &j);
-      j %= len;
-
-      c = string[i];
+      char c = string[i];
       string[i] = string[j];
       string[j] = c;
     }

Modified: trunk/libc/sysdeps/alpha/fpu/bits/mathinline.h
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/bits/mathinline.h (original)
+++ trunk/libc/sysdeps/alpha/fpu/bits/mathinline.h Wed May 16 07:10:16 2007
@@ -137,11 +137,14 @@
   return isunordered (__x, __x);
 }
 
+#ifndef __NO_LONG_DOUBLE_MATH
 __MATH_INLINE int
 __NTH (__isnanl (long double __x))
 {
   return isunordered (__x, __x);
 }
+#endif
+
 #endif /* C99 */
 
 #endif /* __NO_MATH_INLINES */

Modified: trunk/libc/sysdeps/alpha/fpu/s_fmax.S
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_fmax.S (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_fmax.S Wed May 16 07:10:16 2007
@@ -53,6 +53,6 @@
 strong_alias (__fmax, __fmaxl)
 weak_alias (__fmaxl, fmaxl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmax, fmaxl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmax, fmaxl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_fmin.S
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_fmin.S (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_fmin.S Wed May 16 07:10:16 2007
@@ -53,6 +53,6 @@
 strong_alias (__fmin, __fminl)
 weak_alias (__fminl, fminl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __fmin, fminl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __fmin, fminl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_isnan.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_isnan.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_isnan.c Wed May 16 07:10:16 2007
@@ -53,6 +53,7 @@
 strong_alias (__isnan, __isnanl)
 weak_alias (__isnan, isnanl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __isnan, isnanl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+compat_symbol (libc, __isnan, __isnanl, GLIBC_2_0);
+compat_symbol (libc, isnan, isnanl, GLIBC_2_0);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_lrint.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_lrint.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_lrint.c Wed May 16 07:10:16 2007
@@ -42,7 +42,7 @@
 weak_alias (__lrintl, lrintl)
 weak_alias (__llrintl, llrintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lrint, lrintl, GLIBC_2_0);
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lrint, lrintl, GLIBC_2_1);
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_lround.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_lround.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_lround.c Wed May 16 07:10:16 2007
@@ -42,7 +42,7 @@
 weak_alias (__lroundl, lroundl)
 weak_alias (__llroundl, llroundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __lround, lroundl, GLIBC_2_0);
-compat_symbol (libm, __llround, llroundl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __lround, lroundl, GLIBC_2_1);
+compat_symbol (libm, __llround, llroundl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_nearbyint.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_nearbyint.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_nearbyint.c Wed May 16 07:10:16 2007
@@ -43,6 +43,6 @@
 strong_alias (__nearbyint, __nearbyintl)
 weak_alias (__nearbyint, nearbyintl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_round.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_round.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_round.c Wed May 16 07:10:16 2007
@@ -44,6 +44,6 @@
 strong_alias (__round, __roundl)
 weak_alias (__roundl, roundl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __round, roundl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/alpha/fpu/s_trunc.c
==============================================================================
--- trunk/libc/sysdeps/alpha/fpu/s_trunc.c (original)
+++ trunk/libc/sysdeps/alpha/fpu/s_trunc.c Wed May 16 07:10:16 2007
@@ -48,6 +48,6 @@
 strong_alias (__trunc, __truncl)
 weak_alias (__trunc, truncl)
 #endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)
-compat_symbol (libm, __trunc, truncl, GLIBC_2_0);
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __trunc, truncl, GLIBC_2_1);
 #endif

Modified: trunk/libc/sysdeps/ia64/fpu/fraiseexcpt.c
==============================================================================
--- trunk/libc/sysdeps/ia64/fpu/fraiseexcpt.c (original)
+++ trunk/libc/sysdeps/ia64/fpu/fraiseexcpt.c Wed May 16 07:10:16 2007
@@ -1,5 +1,6 @@
 /* Raise given exceptions.
-   Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1998, 2000, 2001, 2002, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jes Sorensen <Jes.Sorensen@xxxxxxx>, 2000.
 
@@ -70,7 +71,7 @@
   if (FE_INEXACT & excepts)
     {
       dummy = DBL_MAX;
-      __asm__ __volatile__ ("fadd.d.s0 %0=%1,f1" : "=f" (dummy) : "0" (dummy));
+      __asm__ __volatile__ ("fsub.d.s0 %0=%1,f1" : "=f" (dummy) : "0" (dummy));
     }
 
   /* Success.  */

Modified: trunk/libc/sysdeps/powerpc/bits/fenv.h
==============================================================================
--- trunk/libc/sysdeps/powerpc/bits/fenv.h (original)
+++ trunk/libc/sysdeps/powerpc/bits/fenv.h Wed May 16 07:10:16 2007
@@ -197,11 +197,21 @@
 # define FE_NONIEEE_ENV	(&__fe_nonieee_env)
 
 /* Floating-point environment with all exceptions enabled.  Note that
-   just evaluating this value will set the processor into 'FPU
-   exceptions imprecise recoverable' mode, which may cause a significant
-   performance penalty (but have no other visible effect).  */
+   just evaluating this value does not change the processor exception mode.
+   Passing this mask to fesetenv will result in a prctl syscall to change
+   the MSR FE0/FE1 bits to "Precise Mode".  On some processors this will
+   result in slower floating point execution.  This will last until an
+   fenv or exception mask is installed that disables all FP exceptions.  */
 extern const fenv_t *__fe_nomask_env (void);
-# define FE_NOMASK_ENV	(__fe_nomask_env ())
-#endif
-
-#endif
+# define FE_NOMASK_ENV	FE_ENABLED_ENV
+
+/* Floating-point environment with all exceptions disabled.  Note that
+   just evaluating this value does not change the processor exception mode.
+   Passing this mask to fesetenv will result in a prctl syscall to change
+   the MSR FE0/FE1 bits to "Ignore Exceptions Mode".  On most processors
+   this allows the fastest possible floating point execution.*/
+extern const fenv_t *__fe_mask_env (void);
+# define FE_MASK_ENV	FE_DFL_ENV
+#endif
+
+#endif

Modified: trunk/libc/sysdeps/powerpc/fpu/Makefile
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/Makefile (original)
+++ trunk/libc/sysdeps/powerpc/fpu/Makefile Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 ifeq ($(subdir),math)
-libm-support += fenv_const fe_nomask t_sqrt
+libm-support += fenv_const fe_nomask fe_mask t_sqrt
 
 # libm needs ld.so to access dl_hwcap
 $(objpfx)libm.so: $(elfobjdir)/ld.so

Modified: trunk/libc/sysdeps/powerpc/fpu/fe_nomask.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/fe_nomask.c (original)
+++ trunk/libc/sysdeps/powerpc/fpu/fe_nomask.c Wed May 16 07:10:16 2007
@@ -20,8 +20,9 @@
 #include <fenv.h>
 #include <errno.h>
 
-/* This is presently a stub, until it's decided how the kernels should
-   support this.  */
+/* This is a generic stub. An OS specific override is required to set
+   the FE0/FE1 bits in the MSR.  MSR update is privileged, so this will
+   normally involve a syscall.  */
 
 const fenv_t *
 __fe_nomask_env(void)

Modified: trunk/libc/sysdeps/powerpc/fpu/fedisblxcpt.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/fedisblxcpt.c (original)
+++ trunk/libc/sysdeps/powerpc/fpu/fedisblxcpt.c Wed May 16 07:10:16 2007
@@ -24,7 +24,7 @@
 fedisableexcept (int excepts)
 {
   fenv_union_t fe;
-  int result;
+  int result, new;
 
   result = fegetexcept ();
 
@@ -44,7 +44,11 @@
     fe.l[1] &= ~(1 << (31 - FPSCR_VE));
   fesetenv_register (fe.fenv);
 
-  if ((fegetexcept () & excepts) != 0)
+  new = fegetexcept ();
+  if (new == 0 && result != 0)
+    (void)__fe_mask_env ();
+
+  if ((new & excepts) != 0)
     result = -1;
   return result;
 }

Modified: trunk/libc/sysdeps/powerpc/fpu/feholdexcpt.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/feholdexcpt.c (original)
+++ trunk/libc/sysdeps/powerpc/fpu/feholdexcpt.c Wed May 16 07:10:16 2007
@@ -22,17 +22,24 @@
 int
 feholdexcept (fenv_t *envp)
 {
-  fenv_union_t u;
+  fenv_union_t old, new;
 
-  /* Get the current state.  */
-  u.fenv = *envp = fegetenv_register ();
+  /* Save the currently set exceptions.  */
+  old.fenv = *envp = fegetenv_register ();
 
-  /* Clear everything except for the rounding mode and non-IEEE arithmetic
+  /* Clear everything except for the rounding modes and non-IEEE arithmetic
      flag.  */
-  u.l[1] = u.l[1] & 7;
+  new.l[1] = old.l[1] & 7;
+  new.l[0] = old.l[0];
+  
+  /* If the old env had any eabled exceptions, then mask SIGFPE in the
+     MSR FE0/FE1 bits.  This may allow the FPU to run faster because it
+     always takes the default action and can not generate SIGFPE. */
+  if ((old.l[1] & 0x000000F8) != 0)
+    (void)__fe_mask_env ();
 
   /* Put the new state in effect.  */
-  fesetenv_register (u.fenv);
+  fesetenv_register (new.fenv);
 
   return 0;
 }

Modified: trunk/libc/sysdeps/powerpc/fpu/fesetenv.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/fesetenv.c (original)
+++ trunk/libc/sysdeps/powerpc/fpu/fesetenv.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Install given floating-point environment.
-   Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 1997,99,2000,01,02,07 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
@@ -23,6 +23,26 @@
 int
 __fesetenv (const fenv_t *envp)
 {
+  fenv_union_t old, new;
+
+  /* get the currently set exceptions.  */
+  new.fenv = *envp;
+  old.fenv = fegetenv_register ();
+  
+  /* If the old env has no eabled exceptions and the new env has any enabled
+     exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits.  This will put
+     the hardware into "precise mode" and may cause the FPU to run slower on
+     some hardware.  */
+  if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
+    (void)__fe_nomask_env ();
+  
+  /* If the old env had any eabled exceptions and the new env has no enabled
+     exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
+     FPU to run faster because it always takes the default action and can not 
+     generate SIGFPE. */
+  if ((old.l[1] & 0x000000F8) != 0 && (new.l[1] & 0x000000F8) == 0)
+    (void)__fe_mask_env ();
+    
   fesetenv_register (*envp);
 
   /* Success.  */

Modified: trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c
==============================================================================
--- trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c (original)
+++ trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Install given floating-point environment and raise exceptions.
-   Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+   Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -30,8 +30,24 @@
   new.fenv = *envp;
   old.fenv = fegetenv_register ();
 
-  /* Copy the set exceptions from `old' to `new'.  */
-  new.l[1] = (new.l[1] & 0xE00000FF) | (old.l[1] & 0x1FFFFF00);
+  /* Restore rounding mode and exception enable from *envp and merge
+     exceptions.  Leave fraction rounded/inexact and FP result/CC bits
+     unchanged.  */
+  new.l[1] = (old.l[1] & 0x1FFFFF00) | (new.l[1] & 0x1FF80FFF);
+  
+  /* If the old env has no eabled exceptions and the new env has any enabled
+     exceptions, then unmask SIGFPE in the MSR FE0/FE1 bits.  This will put
+     the hardware into "precise mode" and may cause the FPU to run slower on
+     some hardware.  */
+  if ((old.l[1] & 0x000000F8) == 0 && (new.l[1] & 0x000000F8) != 0)
+    (void)__fe_nomask_env ();
+  
+  /* If the old env had any eabled exceptions and the new env has no enabled
+     exceptions, then mask SIGFPE in the MSR FE0/FE1 bits.  This may allow the
+     FPU to run faster because it always takes the default action and can not 
+     generate SIGFPE. */
+  if ((old.l[1] & 0x000000F8) != 0 && (new.l[1] & 0x000000F8) == 0)
+    (void)__fe_mask_env ();
 
   /* Atomically enable and raise (if appropriate) exceptions set in `new'. */
   fesetenv_register (new.fenv);

Modified: trunk/libc/sysdeps/s390/fpu/feholdexcpt.c
==============================================================================
--- trunk/libc/sysdeps/s390/fpu/feholdexcpt.c (original)
+++ trunk/libc/sysdeps/s390/fpu/feholdexcpt.c Wed May 16 07:10:16 2007
@@ -1,5 +1,5 @@
 /* Store current floating-point environment and clear exceptions.
-   Copyright (C) 2000, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2005, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Denis Joseph Barrow (djbarrow@xxxxxxxxxx).
 
@@ -23,13 +23,14 @@
 
 int feholdexcept (fenv_t *envp)
 {
+  fexcept_t fpc;
   /* Store the environment.  */
   fegetenv (envp);
   /* Clear the current sticky bits as more than one exception
      may be generated.  */
-  envp->fpc &= ~(FPC_FLAGS_MASK | FPC_DXC_MASK);
+  fpc = envp->fpc & ~(FPC_FLAGS_MASK | FPC_DXC_MASK);
   /* Hold from generating fpu exceptions temporarily.  */
-  _FPU_SETCW ((envp->fpc & ~(FE_ALL_EXCEPT << FPC_EXCEPTION_MASK_SHIFT)));
+  _FPU_SETCW ((fpc & ~(FE_ALL_EXCEPT << FPC_EXCEPTION_MASK_SHIFT)));
   return 0;
 }
 libm_hidden_def (feholdexcept)

Modified: trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/Makefile (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/Makefile Wed May 16 07:10:16 2007
@@ -116,6 +116,8 @@
 sysdep_headers += bits/initspin.h
 
 sysdep_routines += exit-thread sched_getcpu
+
+tests += tst-getcpu
 endif
 
 ifeq ($(subdir),inet)

Modified: trunk/libc/sysdeps/unix/sysv/linux/alpha/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/alpha/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/alpha/bits/stat.h Wed May 16 07:10:16 2007
@@ -149,3 +149,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/alpha/ioperm.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/alpha/ioperm.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/alpha/ioperm.c Wed May 16 07:10:16 2007
@@ -31,6 +31,11 @@
    space.  It is therefore unreasonable to expect mmap'ing the entire
    sparse address space would work (e.g., the Low Cost Alpha chip has an
    I/O address space that's 512MB large!).  */
+
+/* Make sure the ldbu/stb asms below are not expaneded to macros.  */
+#ifndef __alpha_bwx__
+asm(".arch ev56");
+#endif
 
 #include <errno.h>
 #include <fcntl.h>

Modified: trunk/libc/sysdeps/unix/sysv/linux/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/bits/stat.h Wed May 16 07:10:16 2007
@@ -161,3 +161,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/futimes.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/futimes.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/futimes.c Wed May 16 07:10:16 2007
@@ -20,6 +20,7 @@
 #include <errno.h>
 #include <sysdep.h>
 #include <string.h>
+#include <time.h>
 #include <utime.h>
 #include <sys/time.h>
 #include <stdio-common/_itoa.h>
@@ -27,32 +28,67 @@
 
 #include <kernel-features.h>
 
-/* Change the access time of FILE to TVP[0] and
-   the modification time of FILE to TVP[1], but do not follow symlinks.
 
-   The Linux kernel has no futimes() syscall so we use the /proc
-   filesystem.  */
+#ifndef __ASSUME_UTIMENSAT
+static int miss_utimensat;
+#endif
+
+/* Change the access time of the file associated with FD to TVP[0] and
+   the modification time of FILE to TVP[1].
+
+   Starting with 2.6.22 the Linux kernel has the utimensat syscall which
+   can be used to implement futimes.  Earlier kernels have no futimes()
+   syscall so we use the /proc filesystem.  */
 int
 __futimes (int fd, const struct timeval tvp[2])
 {
+  /* The utimensat system call expects timespec not timeval.  */
+  struct timespec ts[2];
+  if (tvp != NULL)
+    {
+      if (tvp[0].tv_usec < 0 || tvp[0].tv_usec >= 1000000
+          || tvp[1].tv_usec < 0 || tvp[1].tv_usec >= 1000000)
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+
+      TIMEVAL_TO_TIMESPEC (&tvp[0], &ts[0]);
+      TIMEVAL_TO_TIMESPEC (&tvp[1], &ts[1]);
+    }
+
+#ifdef __ASSUME_UTIMENSAT
+  return INLINE_SYSCALL (utimensat, 4, fd, NULL, tvp ? &ts : NULL, 0);
+#else
+  int result;
+# ifdef __NR_utimensat
+  if (!__builtin_expect (miss_utimensat, 0))
+    {
+      result = INLINE_SYSCALL (utimensat, 4, fd, NULL, tvp ? &ts : NULL, 0);
+      if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
+	return result;
+
+      miss_utimensat = 1;
+    }
+# endif
+
   static const char selffd[] = "/proc/self/fd/";
   char fname[sizeof (selffd) + 3 * sizeof (int)];
   fname[sizeof (fname) - 1] = '\0';
   char *cp = _itoa_word ((unsigned int) fd, fname + sizeof (fname) - 1, 10, 0);
   cp = memcpy (cp - sizeof (selffd) + 1, selffd, sizeof (selffd) - 1);
 
-  int result;
-#ifdef __NR_utimes
+# ifdef __NR_utimes
   result = INLINE_SYSCALL (utimes, 2, cp, tvp);
-# ifndef __ASSUME_UTIMES
+#  ifndef __ASSUME_UTIMES
   if (result == -1 && errno == ENOSYS)
+#  endif
 # endif
-#endif
     {
       /* The utimes() syscall does not exist or is not available in the
 	 used kernel.  Use utime().  For this we have to convert to the
 	 data format utime() expects.  */
-#ifndef __ASSUME_UTIMES
+# ifndef __ASSUME_UTIMES
       struct utimbuf buf;
       struct utimbuf *times;
 
@@ -66,7 +102,7 @@
 	times = NULL;
 
       result = INLINE_SYSCALL (utime, 2, cp, times);
-#endif
+# endif
     }
 
   if (result == -1)
@@ -88,14 +124,15 @@
       case ENOENT:
 	/* Validate the file descriptor by letting fcntl set errno to
 	   EBADF if it's bogus.  Otherwise it's a /proc issue.  */
-#if !defined __NR_fcntl && defined __NR_fcntl64
-# define __NR_fcntl __NR_fcntl64
-#endif
+# if !defined __NR_fcntl && defined __NR_fcntl64
+#  define __NR_fcntl __NR_fcntl64
+# endif
 	if (INLINE_SYSCALL (fcntl, 3, fd, F_GETFD, 0) != -1)
 	  __set_errno (ENOSYS);
 	break;
       }
 
   return result;
+#endif
 }
 weak_alias (__futimes, futimes)

Modified: trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/ia64/bits/stat.h Wed May 16 07:10:16 2007
@@ -138,3 +138,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h Wed May 16 07:10:16 2007
@@ -458,3 +458,8 @@
 #if __LINUX_KERNEL_VERSION >= 0x020612
 # define __ASSUME_FUTEX_LOCK_PI	1
 #endif
+
+/* Support for utimensat syscall was added in 2.6.22.  */
+#if __LINUX_KERNEL_VERSION >= 0x020616
+# define __ASSUME_UTIMENSAT	1
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/bits/stat.h Wed May 16 07:10:16 2007
@@ -265,3 +265,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/s390/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/s390/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/s390/bits/stat.h Wed May 16 07:10:16 2007
@@ -254,3 +254,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/sched_setaffinity.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sched_setaffinity.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sched_setaffinity.c Wed May 16 07:10:16 2007
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2007
+   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
@@ -67,7 +68,14 @@
 	return -1;
       }
 
-  return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+  int result = INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
+
+#ifdef RESET_VGETCPU_CACHE
+  if (result != -1)
+    RESET_VGETCPU_CACHE ();
+#endif
+
+  return result;
 }
 versioned_symbol (libc, __sched_setaffinity_new, sched_setaffinity,
 		  GLIBC_2_3_4);

Modified: trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sparc/bits/stat.h Wed May 16 07:10:16 2007
@@ -163,3 +163,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/syscalls.list
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/syscalls.list (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/syscalls.list Wed May 16 07:10:16 2007
@@ -11,7 +11,7 @@
 epoll_ctl	EXTRA	epoll_ctl	i:iiip	epoll_ctl
 epoll_wait	EXTRA	epoll_wait	Ci:ipii	epoll_wait
 epoll_pwait	EXTRA	epoll_pwait	Ci:ipiipi	epoll_pwait
-fdatasync	-	fdatasync	i:i	fdatasync
+fdatasync	-	fdatasync	Ci:i	fdatasync
 flock		-	flock		i:ii	__flock		flock
 fork		-	fork		i:	__libc_fork	__fork fork
 get_kernel_syms	EXTRA	get_kernel_syms	i:p	get_kernel_syms

Modified: trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/stat.h Wed May 16 07:10:16 2007
@@ -201,3 +201,9 @@
 #define	__S_IREAD	0400	/* Read by owner.  */
 #define	__S_IWRITE	0200	/* Write by owner.  */
 #define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#if defined __USE_ATFILE || defined __USE_GNU
+/* XXX This will change to the macro for the next 2008 POSIX revision.  */
+# define UTIME_NOW	((1l << 30) - 1l)
+# define UTIME_OMIT	((1l << 30) - 2l)
+#endif

Modified: trunk/libc/version.h
==============================================================================
--- trunk/libc/version.h (original)
+++ trunk/libc/version.h Wed May 16 07:10:16 2007
@@ -1,4 +1,4 @@
 /* This file just defines the current version number of libc.  */
 
-#define RELEASE "development"
-#define VERSION "2.5.90"
+#define RELEASE "stable"
+#define VERSION "2.6"