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

[commits] r7511 - in /trunk: libc/ libc/elf/ libc/inet/ libc/locale/ libc/locale/programs/ libc/localedata/ libc/localedata/locales/ l...



Author: joseph
Date: Wed Dec 10 08:39:54 2008
New Revision: 7511

Log:
Merge changes between r7357 and r7510 from /fsf/trunk.

Added:
    trunk/libc/inet/tst-getni1.c
      - copied unchanged from r7510, fsf/trunk/libc/inet/tst-getni1.c
    trunk/libc/inet/tst-getni2.c
      - copied unchanged from r7510, fsf/trunk/libc/inet/tst-getni2.c
    trunk/libc/localedata/locales/hne_IN
      - copied unchanged from r7510, fsf/trunk/libc/localedata/locales/hne_IN
    trunk/libc/socket/accept4.c
      - copied unchanged from r7510, fsf/trunk/libc/socket/accept4.c
    trunk/libc/stdlib/tst-unsetenv1.c
      - copied unchanged from r7510, fsf/trunk/libc/stdlib/tst-unsetenv1.c
    trunk/libc/sysdeps/mach/strerror_l.c
      - copied unchanged from r7510, fsf/trunk/libc/sysdeps/mach/strerror_l.c
    trunk/libc/sysdeps/unix/sysv/linux/accept4.c
      - copied unchanged from r7510, fsf/trunk/libc/sysdeps/unix/sysv/linux/accept4.c
    trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S
      - copied unchanged from r7510, fsf/trunk/libc/sysdeps/unix/sysv/linux/i386/accept4.S
    trunk/ports/ChangeLog.alpha
      - copied unchanged from r7510, fsf/trunk/ports/ChangeLog.alpha
    trunk/ports/sysdeps/alpha/
      - copied from r7510, fsf/trunk/ports/sysdeps/alpha/
    trunk/ports/sysdeps/mach/alpha/
      - copied from r7510, fsf/trunk/ports/sysdeps/mach/alpha/
    trunk/ports/sysdeps/mach/hurd/alpha/
      - copied from r7510, fsf/trunk/ports/sysdeps/mach/hurd/alpha/
    trunk/ports/sysdeps/unix/alpha/
      - copied from r7510, fsf/trunk/ports/sysdeps/unix/alpha/
    trunk/ports/sysdeps/unix/sysv/linux/alpha/
      - copied from r7510, fsf/trunk/ports/sysdeps/unix/sysv/linux/alpha/
Removed:
    trunk/libc/nptl/sysdeps/alpha/
    trunk/libc/nptl/sysdeps/unix/sysv/linux/alpha/
    trunk/libc/socket/paccept.c
    trunk/libc/sysdeps/alpha/
    trunk/libc/sysdeps/mach/alpha/
    trunk/libc/sysdeps/mach/hurd/alpha/
    trunk/libc/sysdeps/unix/alpha/
    trunk/libc/sysdeps/unix/sysv/linux/alpha/
    trunk/libc/sysdeps/unix/sysv/linux/i386/paccept.S
    trunk/libc/sysdeps/unix/sysv/linux/paccept.c
    trunk/ports/sysdeps/unix/bsd/osf/alpha/
Modified:
    trunk/libc/ChangeLog
    trunk/libc/NEWS
    trunk/libc/Versions.def
    trunk/libc/configure
    trunk/libc/configure.in
    trunk/libc/elf/elf.h
    trunk/libc/inet/Makefile
    trunk/libc/inet/getnameinfo.c
    trunk/libc/locale/iso-639.def
    trunk/libc/locale/programs/ld-address.c
    trunk/libc/localedata/ChangeLog
    trunk/libc/localedata/SUPPORTED
    trunk/libc/localedata/locales/sd_IN
    trunk/libc/localedata/locales/sd_IN@devanagari
    trunk/libc/login/utmp_file.c
    trunk/libc/nis/nss_nis/nis-hosts.c
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/descr.h
    trunk/libc/nptl/sysdeps/pthread/pthread.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
    trunk/libc/nptl/sysdeps/x86_64/tls.h
    trunk/libc/nscd/connections.c
    trunk/libc/nscd/nscd.h
    trunk/libc/posix/globtest.sh
    trunk/libc/posix/regex_internal.h
    trunk/libc/resolv/nss_dns/dns-host.c
    trunk/libc/resolv/res_init.c
    trunk/libc/resolv/res_send.c
    trunk/libc/scripts/firstversions.awk
    trunk/libc/scripts/versions.awk
    trunk/libc/socket/Makefile
    trunk/libc/socket/Versions
    trunk/libc/socket/sys/socket.h
    trunk/libc/stdlib/Makefile
    trunk/libc/stdlib/setenv.c
    trunk/libc/sysdeps/i386/dl-tlsdesc.S
    trunk/libc/sysdeps/posix/getaddrinfo.c
    trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
    trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h
    trunk/libc/sysdeps/unix/sysv/linux/i386/socket.S
    trunk/libc/sysdeps/unix/sysv/linux/ia64/wordexp.c
    trunk/libc/sysdeps/unix/sysv/linux/kernel-features.h
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
    trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c
    trunk/ports/ChangeLog.arm
    trunk/ports/ChangeLog.mips
    trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
    trunk/ports/sysdeps/unix/sysv/linux/mips/sys/signalfd.h

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Wed Dec 10 08:39:54 2008
@@ -1,3 +1,151 @@
+2008-12-08  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #6545]
+	* sysdeps/unix/sysv/linux/bits/socket.h (SCM_CREDENTIALS): Make
+	available only for __USE_GNU.
+
+	* inet/Makefile (tests): Add tst-getni2.
+	* inet/tst-getni2.c: New file.
+
+	[BZ #7080]
+	* inet/getnameinfo.c (getnameinfo): Check for output buffers being
+	NULL when NI_NAMEREQD is set.
+	Patch mostly by Yang Hongyang <yanghy@xxxxxxxxxxxxxx>.
+	* inet/Makefile (tests): Add tst-getni1.
+	* inet/tst-getni1.c: New file.
+
+2008-12-03  Petr Baudis  <pasky@xxxxxxx>
+
+	[BZ #7067]
+	* nscd/connections.c (invalidate_cache): Use prune_run_lock
+	instead of prune_lock.
+	(nscd_run_prune): Before calling prune_cache, take prune_run_lock.
+	* nscd/nscd.h (database_dyn): Add prune_run_cache.
+
+2008-12-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* resolv/res_send.c (send_dg): Use correct guards for SOCK_CLOEXEC
+	use.
+
+	* sysdeps/unix/sysv/linux/kernel-features.h: Fix typo in accept4
+	handling.
+
+	* resolv/res_init.c (__res_vinit): Always assign to statp->nscount
+	after reading name server list.
+
+	[BZ #7058]
+	* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Fix memory
+	handling for host name aliases.
+
+2008-11-24  Arkadiusz Miśkiewicz  <arekm@xxxxxxxx>
+
+	* sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Use LOAD_PIC_REG
+	instead of doing things manually.
+
+2008-11-26  Chris Steel  <chris.steel.lnx@xxxxxxxxxxxxxx>
+
+	* posix/regex_internal.h (build_wcs_upper_buffer):
+	Return type is reg_error_t.
+
+2008-12-05  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* posix/globtest.sh: Use mktemp to create temporary file and
+	directory.
+
+	* sysdeps/unix/sysv/linux/bits/sched.h (__CPU_SET_S): Handle large
+	sets correctly.
+	(__CPU_CLR_S): Likewise.
+	(__CPU_ISSET_S): Likewise.
+
+2008-12-05  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* scripts/firstversion.awk: Use custom comparison function to compare
+	version numbers.
+	* scripts/versions.awk: Use sort invocation which can handle
+	multi-digit sub-version numbers.
+
+2008-12-04  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* locale/programs/ld-address.c (DEFINE_LANGUAGE_CODE2): Define.
+	* locale/iso-639.def: Add Chhattisgarhi entry.
+
+2008-12-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname3_r): Recognize
+	ESRCH return value.
+	(_nss_dns_gethostbyname4_r): Likewise.
+	* resolv/res_init.c (__res_vinit): Initialize nscount to zero.
+	* sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use
+	gethostbyname4_r, we don't have a separate IPv6 status, so copy
+	the no_data variable.
+
+	* resolv/res_init.c (__res_vinit): Fill in IPv4 name server
+	information at the correct index.
+
+	* socket/sys/socket.h: Declare accept4.
+	* socket/accept4.c: New file.
+	* sysdeps/unix/sysv/linux/accept4.c: New file.
+	* sysdeps/unix/sysv/linux/i386/accept4.S: New file.
+	* socket/Makefile (routines): Add accept4.
+	* socket/Versions: Export accept4 with version GLIBC_2.10.
+	* socket/paccept.c: Removed.
+	* sysdeps/unix/sysv/linux/paccept.c: Removed.
+	* sysdeps/unix/sysv/linux/i386/paccept.S: Removed.
+	* Versions.def: Define GLIBC_2.10 for libc.
+	* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_ACCEPT4.
+
+	* nscd/connections.c: Use accept4.
+
+	* sysdeps/unix/sysv/linux/i386/socket.S: Fix comment.
+
+2008-12-01  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* resolv/res_send.c (send_dg): Create sockets with non-blocking
+	flag already set.
+
+	* stdlib/setenv.c (unsetenv): Don't search environment if it does
+	not exist.
+	* stdlib/Makefile (tests): Add tst-unsetenv1.
+	* stdlib/tst-unsetenv1.c: New file.
+
+2008-11-29  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* login/utmp_file.c (file_writable): New variable.
+	(setutent_file): Don't try to open file for writing.
+	(pututline_file): Before writing, make descriptor writable if
+	necessary.
+
+2008-11-26  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Only restrict search
+	to IPv4 or IPv6 if an interface has been found.
+
+2008-11-26  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/alpha/ipc_priv.h: Renamed to ...
+	* sysdeps/unix/sysv/linux/powerpc/ipc_priv.h: ... here.
+
+	* sysdeps/unix/sysv/linux/alpha/wordexp.c: Renamed to ...
+	* sysdeps/unix/sysv/linux/ia64/wordexp.c: ... here.
+	* sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c: Change #include.
+
+	* elf/elf.h (NT_386_IOPERM): New macro.
+	(NT_PPC_VSX): New macro.
+
+2008-11-25  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* sysdeps/alpha, sysdeps/unix/bsd/osf/alpha,
+	sysdeps/unix/bsd/Attic/osf1/alpha, sysdeps/unix/sysv/linux/alpha,
+	sysdeps/unix/sysv/linux/alpha/alpha, sysdeps/unix/alpha,
+	sysdeps/mach/alpha, sysdeps/mach/hurd/alpha:
+	Subdirectories moved to ports repository.
+	* configure.in (base_machine): Remove alpha case.
+
+2008-11-25  Thomas Schwinge  <tschwinge@xxxxxxx>
+
+	* sysdeps/mach/strerror_l.c: New file.
+
 2008-11-13  Ryan S. Arnold  <rsa@xxxxxxxxxx>
 
 	[BZ #6411]
@@ -3003,7 +3151,7 @@
 
 	* nscd/aicache.c (addhstaiX): Fix default TTL handling.
 
-	* inet/getnetgrent.c (setup): Encrypt static pointer.
+	* inet/getnetgrent_r.c (setup): Encrypt static pointer.
 
 2007-10-28  Ulrich Drepper  <drepper@xxxxxxxxxx>
 

Modified: trunk/libc/NEWS
==============================================================================
--- trunk/libc/NEWS (original)
+++ trunk/libc/NEWS Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2008-11-17
+GNU C Library NEWS -- history of user-visible changes.  2008-12-2
 Copyright (C) 1992-2007, 2008 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -6,6 +6,8 @@
 using `glibc' in the "product" field.
 
 Version 2.10
+
+* New Linux interface: accept4
 
 
 Version 2.9

Modified: trunk/libc/Versions.def
==============================================================================
--- trunk/libc/Versions.def (original)
+++ trunk/libc/Versions.def Wed Dec 10 08:39:54 2008
@@ -26,6 +26,7 @@
   GLIBC_2.7
   GLIBC_2.8
   GLIBC_2.9
+  GLIBC_2.10
 %ifdef USE_IN_LIBIO
   HURD_CTHREADS_0.3
 %endif

Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Wed Dec 10 08:39:54 2008
@@ -2058,7 +2058,6 @@
 # base_machine, we don't change it.
 test -n "$base_machine" || case "$machine" in
 a29k | am29000)	base_machine=a29k machine=a29k ;;
-alpha*)		base_machine=alpha machine=alpha/$machine ;;
 c3[012])	base_machine=cx0 machine=cx0/c30 ;;
 c4[04])		base_machine=cx0 machine=cx0/c40 ;;
 i[34567]86)	base_machine=i386 machine=i386/$machine ;;

Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Wed Dec 10 08:39:54 2008
@@ -489,7 +489,6 @@
 # base_machine, we don't change it.
 test -n "$base_machine" || case "$machine" in
 a29k | am29000)	base_machine=a29k machine=a29k ;;
-alpha*)		base_machine=alpha machine=alpha/$machine ;;
 c3[012])	base_machine=cx0 machine=cx0/c30 ;;
 c4[04])		base_machine=cx0 machine=cx0/c40 ;;
 i[34567]86)	base_machine=i386 machine=i386/$machine ;;

Modified: trunk/libc/elf/elf.h
==============================================================================
--- trunk/libc/elf/elf.h (original)
+++ trunk/libc/elf/elf.h Wed Dec 10 08:39:54 2008
@@ -608,7 +608,9 @@
 #define NT_PRXFPREG	0x46e62b7f	/* Contains copy of user_fxsr_struct */
 #define NT_PPC_VMX	0x100		/* PowerPC Altivec/VMX registers */
 #define NT_PPC_SPE	0x101		/* PowerPC SPE/EVR registers */
+#define NT_PPC_VSX	0x102		/* PowerPC VSX registers */
 #define NT_386_TLS	0x200		/* i386 TLS slots (struct user_desc) */
+#define NT_386_IOPERM	0x201		/* x86 io permission bitmap (1=deny) */
 
 /* Legal values for the note segment descriptor types for object files.  */
 

Modified: trunk/libc/inet/Makefile
==============================================================================
--- trunk/libc/inet/Makefile (original)
+++ trunk/libc/inet/Makefile Wed Dec 10 08:39:54 2008
@@ -59,7 +59,8 @@
 aux-$(OPTION_EGLIBC_INET) += check_pf check_native ifreq
 
 tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
-	 tst-gethnm test-ifaddrs bug-if1 tst-ether_line
+	 tst-gethnm test-ifaddrs bug-if1 tst-ether_line \
+	 tst-getni1 tst-getni2
 tests-$(OPTION_EGLIBC_ADVANCED_INET6) += test-inet6_opt
 
 include ../Rules

Modified: trunk/libc/inet/getnameinfo.c
==============================================================================
--- trunk/libc/inet/getnameinfo.c (original)
+++ trunk/libc/inet/getnameinfo.c Wed Dec 10 08:39:54 2008
@@ -178,6 +178,9 @@
   if (sa == NULL || addrlen < sizeof (sa_family_t))
     return EAI_FAMILY;
 
+  if ((flags & NI_NAMEREQD) && host == NULL && serv == NULL)
+    return EAI_NONAME;
+
   switch (sa->sa_family)
     {
     case AF_LOCAL:

Modified: trunk/libc/locale/iso-639.def
==============================================================================
--- trunk/libc/locale/iso-639.def (original)
+++ trunk/libc/locale/iso-639.def Wed Dec 10 08:39:54 2008
@@ -1,8 +1,9 @@
 /*
- * Defines the languages codes and abbreviations according to ISO 639-[12].
+ * Defines the languages codes and abbreviations according to ISO 639-[123].
  * This is used in ld-address.c (address_finish).
  *
  * Format is: ("English name", 639-1-code, 639-2/T-code, 639-2/B-code)
+ * For some languages which have no 639-2 code the 639-3 code is used.
  * If you find something missing or wrong, please go to the URL
  * http://www.gnu.org/software/libc/bugs.html and follow
  * instructions there to file a bug report.
@@ -89,6 +90,7 @@
 DEFINE_LANGUAGE_CODE ("Chechen", ce, che, che)
 DEFINE_LANGUAGE_CODE3 ("Cherokee", chr, chr)
 DEFINE_LANGUAGE_CODE3 ("Cheyenne", chy, chy)
+DEFINE_LANGUAGE_CODE2 ("Chhattisgarhi", hne)	/* ISO 639-3 */
 DEFINE_LANGUAGE_CODE3 ("Chibcha", chb, chb)
 DEFINE_LANGUAGE_CODE ("Chichewa; Chewa; Nyanja", ny, nya, nya)
 DEFINE_LANGUAGE_CODE ("Chinese", zh, zho, chi)

Modified: trunk/libc/locale/programs/ld-address.c
==============================================================================
--- trunk/libc/locale/programs/ld-address.c (original)
+++ trunk/libc/locale/programs/ld-address.c Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2002, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2002, 2005, 2006, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -57,6 +57,8 @@
   { #Ab, #Term, #Lib },
 #define DEFINE_LANGUAGE_CODE3(Name, Term, Lib) \
   { "", #Term, #Lib },
+#define DEFINE_LANGUAGE_CODE2(Name, Term) \
+  { "", #Term, "" },
 #include "iso-639.def"
 };
 

Modified: trunk/libc/localedata/ChangeLog
==============================================================================
--- trunk/libc/localedata/ChangeLog (original)
+++ trunk/libc/localedata/ChangeLog Wed Dec 10 08:39:54 2008
@@ -1,3 +1,10 @@
+2008-12-05  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* SUPPORTED (SUPPORTED-LOCALES): Add hne_IN.
+
+	* locales/hne_IN: New file.
+	Contributed by Pravin Satpute <psatpute@xxxxxxxxxx>.
+
 2008-10-31  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #6920]

Modified: trunk/libc/localedata/SUPPORTED
==============================================================================
--- trunk/libc/localedata/SUPPORTED (original)
+++ trunk/libc/localedata/SUPPORTED Wed Dec 10 08:39:54 2008
@@ -222,6 +222,7 @@
 he_IL.UTF-8/UTF-8 \
 he_IL/ISO-8859-8 \
 hi_IN/UTF-8 \
+hne_IN/UTF-8 \
 hr_HR.UTF-8/UTF-8 \
 hr_HR/ISO-8859-2 \
 hsb_DE/ISO-8859-2 \

Modified: trunk/libc/localedata/locales/sd_IN
==============================================================================
--- trunk/libc/localedata/locales/sd_IN (original)
+++ trunk/libc/localedata/locales/sd_IN Wed Dec 10 08:39:54 2008
@@ -7,7 +7,7 @@
 LC_IDENTIFICATION
 
 title      "Sindhi language locale for India"
-source     "Redhat, Pune"
+source     "Red Hat, Pune"
 address    "Marisfot III, Marigold Premises, East-Wing, Kalyaninagar, Pune, India-411014"
 contact    ""
 email      "bug-glibc-locales@xxxxxxx"

Modified: trunk/libc/localedata/locales/sd_IN@devanagari
==============================================================================
--- trunk/libc/localedata/locales/sd_IN@devanagari (original)
+++ trunk/libc/localedata/locales/sd_IN@devanagari Wed Dec 10 08:39:54 2008
@@ -6,7 +6,7 @@
 
 LC_IDENTIFICATION
 title      "Sindhi language locale for India"
-source     "Redhat, Pune"
+source     "Red Hat, Pune"
 address    "Marisfot III, Marigold Premises, East-Wing, Kalyaninagar, Pune, India-411014"
 contact    ""
 email      "bug-glibc-locales@xxxxxxx"

Modified: trunk/libc/login/utmp_file.c
==============================================================================
--- trunk/libc/login/utmp_file.c (original)
+++ trunk/libc/login/utmp_file.c Wed Dec 10 08:39:54 2008
@@ -36,6 +36,7 @@
 
 /* Descriptor for the file and position.  */
 static int file_fd = -1;
+static bool file_writable;
 static off64_t file_offset;
 
 /* Cache for the last read entry.  */
@@ -138,7 +139,6 @@
   if (file_fd < 0)
     {
       const char *file_name;
-      int result;
 
       file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name);
 
@@ -147,14 +147,10 @@
 #else
 # define O_flags O_LARGEFILE
 #endif
-      file_fd = open_not_cancel_2 (file_name, O_RDWR | O_flags);
+      file_writable = false;
+      file_fd = open_not_cancel_2 (file_name, O_RDONLY | O_flags);
       if (file_fd == -1)
-	{
-	  /* Hhm, read-write access did not work.  Try read-only.  */
-	  file_fd = open_not_cancel_2 (file_name, O_RDONLY | O_flags);
-	  if (file_fd == -1)
-	    return 0;
-	}
+	return 0;
 
 #ifndef __ASSUME_O_CLOEXEC
 # ifdef O_CLOEXEC
@@ -162,7 +158,7 @@
 # endif
 	{
 	  /* We have to make sure the file is `closed on exec'.  */
-	  result = fcntl_not_cancel (file_fd, F_GETFD, 0);
+	  int result = fcntl_not_cancel (file_fd, F_GETFD, 0);
 	  if (result >= 0)
 	    {
 # ifdef O_CLOEXEC
@@ -403,6 +399,52 @@
   int found;
 
   assert (file_fd >= 0);
+
+  if (! file_writable)
+    {
+      /* We must make the file descriptor writable before going on.  */
+      const char *file_name = TRANSFORM_UTMP_FILE_NAME (__libc_utmp_file_name);
+
+      int new_fd = open_not_cancel_2 (file_name, O_RDWR | O_flags);
+      if (new_fd == -1)
+	return NULL;
+
+#ifndef __ASSUME_O_CLOEXEC
+# ifdef O_CLOEXEC
+      if (__have_o_cloexec <= 0)
+# endif
+	{
+	  /* We have to make sure the file is `closed on exec'.  */
+	  int result = fcntl_not_cancel (file_fd, F_GETFD, 0);
+	  if (result >= 0)
+	    {
+# ifdef O_CLOEXEC
+	      if (__have_o_cloexec == 0)
+		__have_o_cloexec = (result & FD_CLOEXEC) ? 1 : -1;
+
+	      if (__have_o_cloexec < 0)
+# endif
+		result = fcntl_not_cancel (file_fd, F_SETFD,
+					   result | FD_CLOEXEC);
+	    }
+
+	  if (result == -1)
+	    {
+	      close_not_cancel_no_status (file_fd);
+	      return NULL;
+	    }
+	}
+#endif
+
+      if (__lseek64 (new_fd, __lseek64 (file_fd, 0, SEEK_CUR), SEEK_SET) == -1
+	  || dup2 (new_fd, file_fd) < 0)
+	{
+	  close_not_cancel_no_status (new_fd);
+	  return NULL;
+	}
+      close_not_cancel_no_status (new_fd);
+      file_writable = true;
+    }
 
   /* Find the correct place to insert the data.  */
   if (file_offset > 0

Modified: trunk/libc/nis/nss_nis/nis-hosts.c
==============================================================================
--- trunk/libc/nis/nss_nis/nis-hosts.c (original)
+++ trunk/libc/nis/nss_nis/nis-hosts.c Wed Dec 10 08:39:54 2008
@@ -485,24 +485,6 @@
       return retval;
     }
 
-  struct parser_data data;
-  struct hostent host;
-  int parse_res = parse_line (result, &host, &data, buflen, errnop, AF_UNSPEC,
-			      0);
-  if (__builtin_expect (parse_res < 1, 0))
-    {
-      if (parse_res == -1)
-	{
-	  *herrnop = NETDB_INTERNAL;
-	  return NSS_STATUS_TRYAGAIN;
-	}
-      else
-	{
-	  *herrnop = HOST_NOT_FOUND;
-	  return NSS_STATUS_NOTFOUND;
-	}
-    }
-
   if (*pat == NULL)
     {
       uintptr_t pad = (-(uintptr_t) buffer
@@ -524,16 +506,47 @@
       buflen -= sizeof (struct gaih_addrtuple);
     }
 
+  uintptr_t pad = -(uintptr_t) buffer % __alignof__ (struct parser_data);
+  buffer += pad;
+
+  struct parser_data *data = (void *) buffer;
+
+  if (__builtin_expect (buflen < sizeof *data + 1 + pad, 0))
+    goto erange;
+  buflen -= pad;
+
+  struct hostent host;
+  int parse_res = parse_line (result, &host, data, buflen, errnop, AF_UNSPEC,
+			      0);
+  if (__builtin_expect (parse_res < 1, 0))
+    {
+      if (parse_res == -1)
+	{
+	  *herrnop = NETDB_INTERNAL;
+	  return NSS_STATUS_TRYAGAIN;
+	}
+      else
+	{
+	  *herrnop = HOST_NOT_FOUND;
+	  return NSS_STATUS_NOTFOUND;
+	}
+    }
+
   (*pat)->next = NULL;
-  size_t h_name_len = strlen (host.h_name);
-  if (h_name_len >= buflen)
-    goto erange;
-  (*pat)->name = memcpy (buffer, host.h_name, h_name_len + 1);
   (*pat)->family = host.h_addrtype;
   memcpy ((*pat)->addr, host.h_addr_list[0], host.h_length);
   (*pat)->scopeid = 0;
   assert (host.h_addr_list[1] == NULL);
 
+  /* Undo the alignment for parser_data.  */
+  buffer -= pad;
+  buflen += pad;
+
+  size_t h_name_len = strlen (host.h_name) + 1;
+  if (h_name_len >= buflen)
+    goto erange;
+  (*pat)->name = memcpy (buffer, host.h_name, h_name_len);
+
   free (result);
 
   return NSS_STATUS_SUCCESS;

Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Wed Dec 10 08:39:54 2008
@@ -1,3 +1,30 @@
+2008-12-08  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/tls.h (tcbhead_t): Add fields reserved for TM
+	implementation.  Add necessary padding and.
+	* descr.h (struct pthread): Increase padding for tcbhead_t to 24
+	words.
+
+2008-12-04  Kaz Kojima  <kkojima@xxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define FUTEX_WAIT_BITSET
+	and FUTEX_WAKE_BITSET.
+
+2008-12-02  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Define FUTEX_WAIT_BITSET
+	and FUTEX_WAKE_BITSET.
+	* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
+	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
+	* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Likewise.
+
+2008-11-25  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* sysdeps/alpha, sysdeps/unix/sysv/linux/alpha:
+	Subdirectories moved to ports repository as
+	sysdeps/.../nptl subdirectories.
+
 2008-11-12  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	[BZ #7008]

Modified: trunk/libc/nptl/descr.h
==============================================================================
--- trunk/libc/nptl/descr.h (original)
+++ trunk/libc/nptl/descr.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -143,7 +143,7 @@
        is private and subject to change without affecting the official ABI.
        We just have it here in case it might be convenient for some
        implementation-specific instrumentation hack or suchlike.  */
-    void *__padding[16];
+    void *__padding[24];
   };
 
   /* This descriptor's link on the `stack_used' or `__stack_user' list.  */

Modified: trunk/libc/nptl/sysdeps/pthread/pthread.h
==============================================================================
--- trunk/libc/nptl/sysdeps/pthread/pthread.h (original)
+++ trunk/libc/nptl/sysdeps/pthread/pthread.h Wed Dec 10 08:39:54 2008
@@ -655,7 +655,7 @@
 /* Remove a cleanup handler installed by the matching pthread_cleanup_push.
    If EXECUTE is non-zero, the handler function is called. */
 # define pthread_cleanup_pop(execute) \
-      do; while (0); /* Empty to allow label before pthread_cleanup_pop.  */  \
+      do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
     } while (0);							      \
     __pthread_unregister_cancel (&__cancel_buf);			      \
     if (execute)							      \
@@ -691,7 +691,7 @@
    restores the cancellation type that was in effect when the matching
    pthread_cleanup_push_defer was called.  */
 #  define pthread_cleanup_pop_restore_np(execute) \
-      do; while (0); /* Empty to allow label before pthread_cleanup_pop.  */  \
+      do { } while (0);/* Empty to allow label before pthread_cleanup_pop.  */\
     } while (0);							      \
     __pthread_unregister_cancel_restore (&__cancel_buf);		      \
     if (execute)							      \

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -52,6 +52,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE	((4 << 24) | 1)
@@ -86,7 +88,7 @@
 	asm ("andl %%gs:%P1, %0" : "+r" (__fl)				      \
 	     : "i" (offsetof (struct pthread, header.private_futex)));	      \
 	__fl | (fl); }))
-# endif	      
+# endif
 #endif
 
 #ifndef __ASSEMBLER__

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/ia64/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2003.
 
@@ -37,6 +37,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the
@@ -67,7 +69,7 @@
       : (fl))								      \
    : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
 	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif	      
+# endif
 #endif
 
 

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@xxxxxxxxxx>, 2003.
 
@@ -38,6 +38,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the
@@ -67,7 +69,7 @@
       : (fl))								      \
    : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
 	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif	      
+# endif
 #endif
 
 #define lll_futex_wait(futexp, val, private) \
@@ -131,8 +133,8 @@
 			      FUTEX_OP_CLEAR_WAKE_IF_GT_ONE);		      \
     INTERNAL_SYSCALL_ERROR_P (__ret, __err);				      \
   })
-  
-  
+
+
 #ifdef UP
 # define __lll_acq_instr	""
 # define __lll_rel_instr	""

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, 2003.
 
@@ -36,6 +36,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the
@@ -66,7 +68,7 @@
       : (fl))								      \
    : ((fl) | (((private) ^ FUTEX_PRIVATE_FLAG)				      \
 	      & THREAD_GETMEM (THREAD_SELF, header.private_futex))))
-# endif	      
+# endif
 #endif
 
 #define lll_futex_wait(futex, val, private) \

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -34,6 +34,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE	((4 << 24) | 1)

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -52,6 +52,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 #define FUTEX_OP_CLEAR_WAKE_IF_GT_ONE	((4 << 24) | 1)
@@ -87,7 +89,7 @@
 	asm ("andl %%fs:%P1, %0" : "+r" (__fl)				      \
 	     : "i" (offsetof (struct pthread, header.private_futex)));	      \
 	__fl | (fl); }))
-# endif	      
+# endif
 #endif
 
 /* Initializer for lock.  */

Modified: trunk/libc/nptl/sysdeps/x86_64/tls.h
==============================================================================
--- trunk/libc/nptl/sysdeps/x86_64/tls.h (original)
+++ trunk/libc/nptl/sysdeps/x86_64/tls.h Wed Dec 10 08:39:54 2008
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  nptl/x86_64 version.
-   Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -28,6 +28,7 @@
 # include <stdlib.h>
 # include <sysdep.h>
 # include <kernel-features.h>
+# include <bits/wordsize.h>
 
 
 /* Type for the dtv.  */
@@ -56,7 +57,14 @@
   unsigned long int vgetcpu_cache[2];
 #ifndef __ASSUME_PRIVATE_FUTEX
   int private_futex;
-#endif
+#else
+  int __unused1;
+#endif
+#if __WORDSIZE == 64
+  int __pad1;
+#endif
+  /* Reservation of some values for the TM ABI.  */
+  void *__private_tm[5];
 } tcbhead_t;
 
 #else /* __ASSEMBLER__ */

Modified: trunk/libc/nscd/connections.c
==============================================================================
--- trunk/libc/nscd/connections.c (original)
+++ trunk/libc/nscd/connections.c Wed Dec 10 08:39:54 2008
@@ -109,6 +109,7 @@
   [pwddb] = {
     .lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
     .prune_lock = PTHREAD_MUTEX_INITIALIZER,
+    .prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
     .enabled = 0,
     .check_file = 1,
     .persistent = 0,
@@ -129,6 +130,7 @@
   [grpdb] = {
     .lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
     .prune_lock = PTHREAD_MUTEX_INITIALIZER,
+    .prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
     .enabled = 0,
     .check_file = 1,
     .persistent = 0,
@@ -149,6 +151,7 @@
   [hstdb] = {
     .lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
     .prune_lock = PTHREAD_MUTEX_INITIALIZER,
+    .prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
     .enabled = 0,
     .check_file = 1,
     .persistent = 0,
@@ -169,6 +172,7 @@
   [servdb] = {
     .lock = PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
     .prune_lock = PTHREAD_MUTEX_INITIALIZER,
+    .prune_run_lock = PTHREAD_MUTEX_INITIALIZER,
     .enabled = 0,
     .check_file = 1,
     .persistent = 0,
@@ -238,8 +242,9 @@
 /* Negative if SOCK_CLOEXEC is not supported, positive if it is, zero
    before be know the result.  */
 static int have_sock_cloexec;
-/* The paccept syscall was introduced at the same time as SOCK_CLOEXEC.  */
-# define have_paccept -1	// XXX For the time being there is no such call
+#endif
+#ifndef __ASSUME_ACCEPT4
+static int have_accept4;
 #endif
 
 /* Number of times clients had to wait.  */
@@ -975,9 +980,9 @@
 
   if (dbs[number].enabled)
     {
-      pthread_mutex_lock (&dbs[number].prune_lock);
+      pthread_mutex_lock (&dbs[number].prune_run_lock);
       prune_cache (&dbs[number], LONG_MAX, fd);
-      pthread_mutex_unlock (&dbs[number].prune_lock);
+      pthread_mutex_unlock (&dbs[number].prune_run_lock);
     }
   else
     {
@@ -1492,6 +1497,7 @@
   dbs[my_number].wakeup_time = now + CACHE_PRUNE_INTERVAL + my_number;
 
   pthread_mutex_t *prune_lock = &dbs[my_number].prune_lock;
+  pthread_mutex_t *prune_run_lock = &dbs[my_number].prune_run_lock;
   pthread_cond_t *prune_cond = &dbs[my_number].prune_cond;
 
   pthread_mutex_lock (prune_lock);
@@ -1525,7 +1531,12 @@
 
 	  pthread_mutex_unlock (prune_lock);
 
+	  /* We use a separate lock for running the prune function (instead
+	     of keeping prune_lock locked) because this enables concurrent
+	     invocations of cache_add which might modify the timeout value.  */
+	  pthread_mutex_lock (prune_run_lock);
 	  next_wait = prune_cache (&dbs[my_number], prune_now, -1);
+	  pthread_mutex_unlock (prune_run_lock);
 
 	  next_wait = MAX (next_wait, CACHE_PRUNE_INTERVAL);
 	  /* If clients cannot determine for sure whether nscd is running
@@ -1609,8 +1620,8 @@
       /* We are done with the list.  */
       pthread_mutex_unlock (&readylist_lock);
 
-#ifndef __ASSUME_SOCK_CLOEXEC
-      if (have_sock_cloexec < 0)
+#ifndef __ASSUME_ACCEPT4
+      if (have_accept4 < 0)
 	{
 	  /* We do not want to block on a short read or so.  */
 	  int fl = fcntl (fd, F_GETFL);
@@ -1819,22 +1830,20 @@
 	      /* We have a new incoming connection.  Accept the connection.  */
 	      int fd;
 
-#ifndef __ASSUME_PACCEPT
+#ifndef __ASSUME_ACCEPT4
 	      fd = -1;
-	      if (have_paccept >= 0)
+	      if (have_accept4 >= 0)
 #endif
 		{
-#if 0
-		  fd = TEMP_FAILURE_RETRY (paccept (sock, NULL, NULL, NULL,
+		  fd = TEMP_FAILURE_RETRY (accept4 (sock, NULL, NULL,
 						    SOCK_NONBLOCK));
-#ifndef __ASSUME_PACCEPT
-		  if (have_paccept == 0)
-		    have_paccept = fd != -1 || errno != ENOSYS ? 1 : -1;
-#endif
+#ifndef __ASSUME_ACCEPT4
+		  if (have_accept4 == 0)
+		    have_accept4 = fd != -1 || errno != ENOSYS ? 1 : -1;
 #endif
 		}
-#ifndef __ASSUME_PACCEPT
-	      if (have_paccept < 0)
+#ifndef __ASSUME_ACCEPT4
+	      if (have_accept4 < 0)
 		fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
 #endif
 
@@ -2000,7 +2009,7 @@
     /* We cannot use epoll.  */
     return;
 
-#ifdef HAVE_INOTIFY
+# ifdef HAVE_INOTIFY
   if (inotify_fd != -1)
     {
       ev.events = EPOLLRDNORM;
@@ -2010,7 +2019,7 @@
 	return;
       nused = 2;
     }
-#endif
+# endif
 
   while (1)
     {
@@ -2025,8 +2034,26 @@
 	if (revs[cnt].data.fd == sock)
 	  {
 	    /* A new connection.  */
-	    int fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
-
+	    int fd;
+
+# ifndef __ASSUME_ACCEPT4
+	    fd = -1;
+	    if (have_accept4 >= 0)
+# endif
+	      {
+		fd = TEMP_FAILURE_RETRY (accept4 (sock, NULL, NULL,
+						  SOCK_NONBLOCK));
+# ifndef __ASSUME_ACCEPT4
+		if (have_accept4 == 0)
+		  have_accept4 = fd != -1 || errno != ENOSYS ? 1 : -1;
+# endif
+	      }
+# ifndef __ASSUME_ACCEPT4
+	    if (have_accept4 < 0)
+	      fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
+# endif
+
+	    /* Use the descriptor if we have not reached the limit.  */
 	    if (fd >= 0)
 	      {
 		/* Try to add the  new descriptor.  */
@@ -2048,7 +2075,7 @@
 		  }
 	      }
 	  }
-#ifdef HAVE_INOTIFY
+# ifdef HAVE_INOTIFY
 	else if (revs[cnt].data.fd == inotify_fd)
 	  {
 	    bool to_clear[lastdb] = { false, };
@@ -2104,7 +2131,7 @@
 		  pthread_cond_signal (&dbs[dbcnt].prune_cond);
 		}
 	  }
-#endif
+# endif
 	else
 	  {
 	    /* Remove the descriptor from the epoll descriptor.  */

Modified: trunk/libc/nscd/nscd.h
==============================================================================
--- trunk/libc/nscd/nscd.h (original)
+++ trunk/libc/nscd/nscd.h Wed Dec 10 08:39:54 2008
@@ -69,6 +69,7 @@
   pthread_rwlock_t lock;
   pthread_cond_t prune_cond;
   pthread_mutex_t prune_lock;
+  pthread_mutex_t prune_run_lock;
   time_t wakeup_time;
 
   int enabled;

Modified: trunk/libc/posix/globtest.sh
==============================================================================
--- trunk/libc/posix/globtest.sh (original)
+++ trunk/libc/posix/globtest.sh Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 
 common_objpfx=$1; shift
 elf_objpfx=$1; shift
@@ -32,14 +32,11 @@
 
 # Create the arena
 : ${TMPDIR=/tmp}
-testdir=$TMPDIR/globtest-dir
-testout=$TMPDIR/globtest-out
+testdir=$(mktemp -d $TMPDIR/globtest-dir.XXXXXX)
+testout=$(mktemp $TMPDIR/globtest-out.XXXXXX)
 
 trap 'chmod 777 $testdir/noread; rm -fr $testdir $testout' 1 2 3 15
 
-test -d $testdir/noread && chmod 777 $testdir/noread
-rm -fr $testdir 2>/dev/null
-mkdir $testdir
 echo 1 > $testdir/file1
 echo 2 > $testdir/file2
 echo 3 > $testdir/-file3

Modified: trunk/libc/posix/regex_internal.h
==============================================================================
--- trunk/libc/posix/regex_internal.h (original)
+++ trunk/libc/posix/regex_internal.h Wed Dec 10 08:39:54 2008
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2005, 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@xxxxxxxxxxxxxx>.
 
@@ -402,7 +402,8 @@
      internal_function;
 # ifdef RE_ENABLE_I18N
 static void build_wcs_buffer (re_string_t *pstr) internal_function;
-static int build_wcs_upper_buffer (re_string_t *pstr) internal_function;
+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr)
+  internal_function;
 # endif /* RE_ENABLE_I18N */
 static void build_upper_buffer (re_string_t *pstr) internal_function;
 static void re_string_translate_buffer (re_string_t *pstr) internal_function;

Modified: trunk/libc/resolv/nss_dns/dns-host.c
==============================================================================
--- trunk/libc/resolv/nss_dns/dns-host.c (original)
+++ trunk/libc/resolv/nss_dns/dns-host.c Wed Dec 10 08:39:54 2008
@@ -198,8 +198,14 @@
 			  1024, &host_buffer.ptr, NULL, NULL, NULL);
   if (n < 0)
     {
-      status = (errno == ECONNREFUSED
-		? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
+      if (errno == ESRCH)
+	{
+	  status = NSS_STATUS_TRYAGAIN;
+	  h_errno = TRY_AGAIN;
+	}
+      else
+	status = (errno == ECONNREFUSED
+		  ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
       *h_errnop = h_errno;
       if (h_errno == TRY_AGAIN)
 	*errnop = EAGAIN;
@@ -304,8 +310,14 @@
 			      &ans2p, &nans2p, &resplen2);
   if (n < 0)
     {
-      status = (errno == ECONNREFUSED
-		? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
+      if (errno == ESRCH)
+	{
+	  status = NSS_STATUS_TRYAGAIN;
+	  h_errno = TRY_AGAIN;
+	}
+      else
+	status = (errno == ECONNREFUSED
+		  ? NSS_STATUS_UNAVAIL : NSS_STATUS_NOTFOUND);
       *herrnop = h_errno;
       if (h_errno == TRY_AGAIN)
 	*errnop = EAGAIN;

Modified: trunk/libc/resolv/res_init.c
==============================================================================
--- trunk/libc/resolv/res_init.c (original)
+++ trunk/libc/resolv/res_init.c Wed Dec 10 08:39:54 2008
@@ -183,7 +183,7 @@
 #endif
 	statp->nsaddr.sin_family = AF_INET;
 	statp->nsaddr.sin_port = htons(NAMESERVER_PORT);
-	statp->nscount = 1;
+	statp->nscount = 0;
 	statp->ndots = 1;
 	statp->pfcode = 0;
 	statp->_vcsock = -1;
@@ -314,9 +314,9 @@
 			cp++;
 		    if ((*cp != '\0') && (*cp != '\n')
 			&& __inet_aton(cp, &a)) {
-			statp->nsaddr_list[nserv].sin_addr = a;
-			statp->nsaddr_list[nserv].sin_family = AF_INET;
-			statp->nsaddr_list[nserv].sin_port =
+			statp->nsaddr_list[nservall].sin_addr = a;
+			statp->nsaddr_list[nservall].sin_family = AF_INET;
+			statp->nsaddr_list[nservall].sin_port =
 				htons(NAMESERVER_PORT);
 			nserv++;
 #ifdef _LIBC
@@ -420,8 +420,7 @@
 		    continue;
 		}
 	    }
-	    if (nserv > 1)
-		statp->nscount = nserv;
+	    statp->nscount = nserv;
 #ifdef _LIBC
 	    if (nservall - nserv > 0) {
 		statp->_u._ext.nscount6 = nservall - nserv;

Modified: trunk/libc/resolv/res_send.c
==============================================================================
--- trunk/libc/resolv/res_send.c (original)
+++ trunk/libc/resolv/res_send.c Wed Dec 10 08:39:54 2008
@@ -95,11 +95,19 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <kernel-features.h>
 
 #if PACKETSZ > 65536
 #define MAXPACKET       PACKETSZ
 #else
 #define MAXPACKET       65536
+#endif
+
+
+#ifndef __ASSUME_SOCK_CLOEXEC
+static int __have_o_nonblock;
+#else
+# define __have_o_nonblock 0
 #endif
 
 
@@ -920,8 +928,20 @@
 	if (EXT(statp).nssocks[ns] == -1) {
 		/* only try IPv6 if IPv6 NS and if not failed before */
 		if ((EXT(statp).nscount6 > 0) && !statp->ipv6_unavail) {
-			EXT(statp).nssocks[ns] =
-			    socket(PF_INET6, SOCK_DGRAM, 0);
+			if (__have_o_nonblock >= 0) {
+				EXT(statp).nssocks[ns] =
+				  socket(PF_INET6, SOCK_DGRAM|SOCK_NONBLOCK,
+					 0);
+#ifndef __ASSUME_SOCK_CLOEXEC
+				if (__have_o_nonblock == 0)
+					__have_o_nonblock
+					  = (EXT(statp).nssocks[ns] == -1
+					     && errno == EINVAL ? -1 : 1);
+#endif
+			}
+			if (__have_o_nonblock < 0)
+				EXT(statp).nssocks[ns] =
+				  socket(PF_INET6, SOCK_DGRAM, 0);
 			if (EXT(statp).nssocks[ns] < 0)
 			    statp->ipv6_unavail = errno == EAFNOSUPPORT;
 			/* If IPv6 socket and nsap is IPv4, make it
@@ -929,8 +949,22 @@
 			else if (nsap->sin6_family == AF_INET)
 			    convaddr4to6(nsap);
 		}
-		if (EXT(statp).nssocks[ns] < 0)
-			EXT(statp).nssocks[ns] = socket(PF_INET, SOCK_DGRAM, 0);
+		if (EXT(statp).nssocks[ns] < 0) {
+			if (__have_o_nonblock >= 0) {
+				EXT(statp).nssocks[ns]
+				  = socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK,
+					   0);
+#ifndef __ASSUME_SOCK_CLOEXEC
+				if (__have_o_nonblock == 0)
+					__have_o_nonblock
+					  = (EXT(statp).nssocks[ns] == -1
+					     && errno == EINVAL ? -1 : 1);
+#endif
+			}
+			if (__have_o_nonblock < 0)
+				EXT(statp).nssocks[ns]
+				  = socket(PF_INET, SOCK_DGRAM, 0);
+		}
 		if (EXT(statp).nssocks[ns] < 0) {
 			*terrno = errno;
 			Perror(statp, stderr, "socket(dg)", errno);
@@ -955,13 +989,15 @@
 			__res_iclose(statp, false);
 			return (0);
 		}
-		/* Make socket non-blocking.  */
-		int fl = __fcntl (EXT(statp).nssocks[ns], F_GETFL);
-		if  (fl != -1)
-			__fcntl (EXT(statp).nssocks[ns], F_SETFL,
-				 fl | O_NONBLOCK);
-		Dprint(statp->options & RES_DEBUG,
-		       (stdout, ";; new DG socket\n"))
+		if (__have_o_nonblock < 0) {
+			/* Make socket non-blocking.  */
+			int fl = __fcntl (EXT(statp).nssocks[ns], F_GETFL);
+			if  (fl != -1)
+				__fcntl (EXT(statp).nssocks[ns], F_SETFL,
+					 fl | O_NONBLOCK);
+			Dprint(statp->options & RES_DEBUG,
+			       (stdout, ";; new DG socket\n"))
+		}
 	}
 
 	/*

Modified: trunk/libc/scripts/firstversions.awk
==============================================================================
--- trunk/libc/scripts/firstversions.awk (original)
+++ trunk/libc/scripts/firstversions.awk Wed Dec 10 08:39:54 2008
@@ -1,5 +1,30 @@
 # Script to preprocess Versions.all lists based on "earliest version"
 # specifications in the shlib-versions file.
+
+# Return -1, 0 or 1 according to whether v1 is less than, equal to or
+# greater than v2 as a version string. Simplified from GNU Autoconf
+# version; this one does not need to handle .0x fraction-style versions.
+function vers_compare (v1, v2)
+{
+  while (length(v1) && length(v2)) {
+    if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) {
+      for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue;
+      for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue;
+      d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1);
+      d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1);
+      d1 += 0;
+      d2 += 0;
+    } else {
+      d1 = substr(v1, 1, 1); v1 = substr(v1, 2);
+      d2 = substr(v2, 1, 1); v2 = substr(v2, 2);
+    }
+    if (d1 < d2) return -1;
+    if (d1 > d2) return 1;
+  }
+  if (length(v2)) return -1;
+  if (length(v1)) return 1;
+  return 0;
+}
 
 NF > 2 && $2 == ":" {
   for (i = 0; i <= NF - 3; ++i)
@@ -25,10 +50,8 @@
 
 {
   if ((thislib, idx[thislib]) in firstversion) {
-    # XXX relative string comparison loses if we ever have multiple digits
-    # between dots in GLIBC_x.y[.z] names.
     f = v = firstversion[thislib, idx[thislib]];
-    while ($1 >= v) {
+    while (vers_compare($1, v) >= 0) {
       delete firstversion[thislib, idx[thislib]];
       idx[thislib]++;
       if ((thislib, idx[thislib]) in firstversion)
@@ -39,7 +62,7 @@
     if ($1 == v || $1 == f)
       # This version was the specified earliest version itself.
       print;
-    else if ($1 < v) {
+    else if (vers_compare($1, v) < 0) {
       # This version is older than the specified earliest version.
       print "  " $1, "=", v;
       # Record that V has been referred to, so we will be sure to emit it

Modified: trunk/libc/scripts/versions.awk
==============================================================================
--- trunk/libc/scripts/versions.awk (original)
+++ trunk/libc/scripts/versions.awk Wed Dec 10 08:39:54 2008
@@ -28,10 +28,8 @@
   close(defsfile);
 
   tmpfile = buildroot "Versions.tmp";
-  # Note this sorting presumes only single digits between dots for proper
-  # numeric ordering.  sort -n doesn't do quite the right thing either,
-  # and in some non-GNU sort implementations does not sort at all.
-  sort = "sort > " tmpfile;
+  # POSIX sort needed.
+  sort = "sort -t. -k 1,1 -k 2n,2n -k 3 > " tmpfile;
 }
 
 # Remove comment lines.
@@ -135,5 +133,5 @@
   printf("\n");
   closeversion(oldver, veryoldver);
   close_and_move(outfile, real_outfile);
-  system("rm -f " tmpfile);
+  #system("rm -f " tmpfile);
 }

Modified: trunk/libc/socket/Makefile
==============================================================================
--- trunk/libc/socket/Makefile (original)
+++ trunk/libc/socket/Makefile Wed Dec 10 08:39:54 2008
@@ -27,7 +27,7 @@
 routines := accept bind connect getpeername getsockname getsockopt	\
 	    listen recv recvfrom recvmsg send sendmsg sendto		\
 	    setsockopt shutdown socket socketpair isfdtype opensock	\
-	    sockatmark
+	    sockatmark accept4
 
 aux	 := have_sock_cloexec
 

Modified: trunk/libc/socket/Versions
==============================================================================
--- trunk/libc/socket/Versions (original)
+++ trunk/libc/socket/Versions Wed Dec 10 08:39:54 2008
@@ -31,4 +31,7 @@
     # Addition from P1003.1-200x
     sockatmark;
   }
+  GLIBC_2.10 {
+    accept4;
+  }
 }

Modified: trunk/libc/socket/sys/socket.h
==============================================================================
--- trunk/libc/socket/sys/socket.h (original)
+++ trunk/libc/socket/sys/socket.h Wed Dec 10 08:39:54 2008
@@ -214,6 +214,15 @@
 extern int accept (int __fd, __SOCKADDR_ARG __addr,
 		   socklen_t *__restrict __addr_len);
 
+#ifdef __USE_GNU
+/* Similar to 'accept' but takes an additional parameter to specify flags.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int accept4 (int __fd, __SOCKADDR_ARG __addr,
+		    socklen_t *__restrict __addr_len, int __flags);
+#endif
+
 /* Shut down all or part of the connection open on socket FD.
    HOW determines what to shut down:
      SHUT_RD   = No more receptions;

Modified: trunk/libc/stdlib/Makefile
==============================================================================
--- trunk/libc/stdlib/Makefile (original)
+++ trunk/libc/stdlib/Makefile Wed Dec 10 08:39:54 2008
@@ -77,7 +77,8 @@
 		   tst-limits tst-rand48 bug-strtod tst-setcontext	    \
 		   test-a64l tst-qsort tst-system bug-strtod2		    \
 		   tst-atof1 tst-atof2 tst-strtod2 tst-rand48-2             \
-		   tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6
+		   tst-makecontext tst-qsort2 tst-makecontext2 tst-strtod6  \
+		   tst-unsetenv1
 tests-$(OPTION_EGLIBC_LOCALE_CODE) \
 		+= tst-strtod3 tst-strtod4 tst-strtod5 testmb2
 tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \

Modified: trunk/libc/stdlib/setenv.c
==============================================================================
--- trunk/libc/stdlib/setenv.c (original)
+++ trunk/libc/stdlib/setenv.c Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-2001,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-2001,2004, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -292,19 +292,20 @@
   LOCK;
 
   ep = __environ;
-  while (*ep != NULL)
-    if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
-      {
-	/* Found it.  Remove this pointer by moving later ones back.  */
-	char **dp = ep;
-
-	do
-	  dp[0] = dp[1];
-	while (*dp++);
-	/* Continue the loop in case NAME appears again.  */
-      }
-    else
-      ++ep;
+  if (ep != NULL)
+    while (*ep != NULL)
+      if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
+	{
+	  /* Found it.  Remove this pointer by moving later ones back.  */
+	  char **dp = ep;
+
+	  do
+	    dp[0] = dp[1];
+	  while (*dp++);
+	  /* Continue the loop in case NAME appears again.  */
+	}
+      else
+	++ep;
 
   UNLOCK;
 

Modified: trunk/libc/sysdeps/i386/dl-tlsdesc.S
==============================================================================
--- trunk/libc/sysdeps/i386/dl-tlsdesc.S (original)
+++ trunk/libc/sysdeps/i386/dl-tlsdesc.S Wed Dec 10 08:39:54 2008
@@ -128,8 +128,7 @@
 .Lslow:
 	cfi_adjust_cfa_offset (28)
 	movl	%ebx, 16(%esp)
-	call	__i686.get_pc_thunk.bx
-	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
+	LOAD_PIC_REG (bx)
 	call	___tls_get_addr@PLT
 	movl	16(%esp), %ebx
 	jmp	.Lret

Modified: trunk/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- trunk/libc/sysdeps/posix/getaddrinfo.c (original)
+++ trunk/libc/sysdeps/posix/getaddrinfo.c Wed Dec 10 08:39:54 2008
@@ -733,6 +733,8 @@
 					      tmpbuflen, 2 * tmpbuflen);
 		    }
 
+		  no_inet6_data = no_data;
+
 		  if (status == NSS_STATUS_SUCCESS)
 		    {
 		      if ((req->ai_flags & AI_CANONNAME) != 0 && canon == NULL)
@@ -2108,7 +2110,7 @@
 	{
 	  /* If we haven't seen both IPv4 and IPv6 interfaces we can
 	     narrow down the search.  */
-	  if (! seen_ipv4 || ! seen_ipv6)
+	  if ((! seen_ipv4 || ! seen_ipv6) && (seen_ipv4 || seen_ipv6))
 	    {
 	      local_hints = *hints;
 	      local_hints.ai_family = seen_ipv4 ? PF_INET : PF_INET6;

Modified: trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h Wed Dec 10 08:39:54 2008
@@ -131,26 +131,31 @@
   do {									      \
     size_t __i;								      \
     size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
-    cpu_set_t *__arr = (cpusetp);					      \
+    __cpu_mask *__bits = (cpusetp)->__bits;				      \
     for (__i = 0; __i < __imax; ++__i)					      \
-      __arr->__bits[__i] = 0;						      \
+      __bits[__i] = 0;							      \
   } while (0)
 # endif
 # define __CPU_SET_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
       __cpu < 8 * (setsize)						      \
-      ? ((cpusetp)->__bits[__CPUELT (__cpu)] |= __CPUMASK (__cpu)) : 0; }))
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 |= __CPUMASK (__cpu))						      \
+      : 0; }))
 # define __CPU_CLR_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
       __cpu < 8 * (setsize)						      \
-      ? ((cpusetp)->__bits[__CPUELT (__cpu)] &= ~__CPUMASK (__cpu)) : 0; }))
+      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
+	 &= ~__CPUMASK (__cpu))						      \
+      : 0; }))
 # define __CPU_ISSET_S(cpu, setsize, cpusetp) \
   (__extension__							      \
    ({ size_t __cpu = (cpu);						      \
       __cpu < 8 * (setsize)						      \
-      ? (((cpusetp)->__bits[__CPUELT (__cpu)] & __CPUMASK (__cpu))) != 0      \
+      ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]	      \
+	  & __CPUMASK (__cpu))) != 0					      \
       : 0; }))
 
 # define __CPU_COUNT_S(setsize, cpusetp) \
@@ -162,12 +167,12 @@
 # else
 #  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
   (__extension__							      \
-   ({ cpu_set_t *__arr1 = (cpusetp1);					      \
-      cpu_set_t *__arr2 = (cpusetp2);					      \
+   ({ __cpu_mask *__arr1 = (cpusetp1)->__bits;				      \
+      __cpu_mask *__arr2 = (cpusetp2)->__bits;				      \
       size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
       size_t __i;							      \
       for (__i = 0; __i < __imax; ++__i)				      \
-	if (__arr1->__bits[__i] != __arr2->__bits[__i])			      \
+	if (__bits[__i] != __bits[__i])					      \
 	  break;							      \
       __i == __imax; }))
 # endif
@@ -175,12 +180,12 @@
 # define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
   (__extension__							      \
    ({ cpu_set_t *__dest = (destset);					      \
-      cpu_set_t *__arr1 = (srcset1);					      \
-      cpu_set_t *__arr2 = (srcset2);					      \
+      __cpu_mask *__arr1 = (srcset1)->__bits;				      \
+      __cpu_mask *__arr2 = (srcset2)->__bits;				      \
       size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
       size_t __i;							      \
       for (__i = 0; __i < __imax; ++__i)				      \
-	__dest->__bits[__i] = __arr1->__bits[__i] op __arr2->__bits[__i];     \
+	((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i];    \
       __dest; }))
 
 # define __CPU_ALLOC_SIZE(count) \

Modified: trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/bits/socket.h Wed Dec 10 08:39:54 2008
@@ -309,7 +309,7 @@
   {
     SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
 #define SCM_RIGHTS SCM_RIGHTS
-#ifdef __USE_BSD
+#ifdef __USE_GNU
     , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
 # define SCM_CREDENTIALS SCM_CREDENTIALS
 #endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/i386/socket.S
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/i386/socket.S (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/i386/socket.S Wed Dec 10 08:39:54 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995-1998,2002,2003,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1998,2002,2003,2005,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
 #define P2(a, b) a##b
 
 	.text
-/* The socket-oriented system calls are handled unusally in Linux.
+/* The socket-oriented system calls are handled unusally in Linux/i386.
    They are all gated through the single `socketcall' system call number.
    `socketcall' takes two arguments: the first is the subcode, specifying
    which socket function is being called; and the second is a pointer to

Modified: trunk/libc/sysdeps/unix/sysv/linux/ia64/wordexp.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/ia64/wordexp.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/ia64/wordexp.c Wed Dec 10 08:39:54 2008
@@ -1,1 +1,60 @@
-#include <sysdeps/unix/sysv/linux/alpha/wordexp.c>
+/* Copyright (C) 2001, 2004, 2005 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <shlib-compat.h>
+
+/* For Linux/Alpha we have to make the wordexp symbols versioned.  */
+#define wordexp(words, pwordexp, flags) \
+  __new_wordexp (words, pwordexp, flags)
+
+#include <posix/wordexp.c>
+
+versioned_symbol (libc, __new_wordexp, wordexp, GLIBC_2_2_2);
+
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2_2)
+/* The old, incorrect wordexp_t definition.  */
+typedef struct
+  {
+    int we_wordc;		/* Count of words matched.  */
+    char **we_wordv;		/* List of expanded words.  */
+    int we_offs;		/* Slots to reserve in `we_wordv'.  */
+  } old_wordexp_t;
+
+
+int
+attribute_compat_text_section
+__old_wordexp (const char *words, old_wordexp_t *pwordexp, int flags)
+{
+  wordexp_t we;
+  int result;
+
+  we.we_wordc = pwordexp->we_wordc;
+  we.we_wordv = pwordexp->we_wordv;
+  we.we_offs = pwordexp->we_offs;
+
+  result = __new_wordexp (words, &we, flags);
+
+  pwordexp->we_wordc = we.we_wordc;
+  pwordexp->we_wordv = we.we_wordv;
+  pwordexp->we_offs = we.we_offs;
+
+  return result;
+}
+compat_symbol (libc, __old_wordexp, wordexp, GLIBC_2_1);
+#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 Dec 10 08:39:54 2008
@@ -509,5 +509,11 @@
 # define __ASSUME_SOCK_CLOEXEC	1
 # define __ASSUME_IN_NONBLOCK	1
 # define __ASSUME_PIPE2		1
-# define __ASSUME_PACCEPT	1
-#endif
+#endif
+
+/* Support for the accept4 syscall was added in 2.6.28.  */
+#if __LINUX_KERNEL_VERSION >= 0x02061c \
+    && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \
+	|| defined __ia64__ || defined __sparc__ || __s390__)
+# define __ASSUME_ACCEPT4	1
+#endif

Modified: trunk/libc/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h Wed Dec 10 08:39:54 2008
@@ -1,1 +1,47 @@
-#include <sysdeps/unix/sysv/linux/alpha/ipc_priv.h>
+/* Copyright (C) 1995-1999, 2000, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sys/ipc.h>
+
+#define __IPC_64	0x100
+
+struct __old_ipc_perm
+{
+  __key_t __key;			/* Key.  */
+  unsigned int uid;			/* Owner's user ID.  */
+  unsigned int gid;			/* Owner's group ID.  */
+  unsigned int cuid;			/* Creator's user ID.  */
+  unsigned int cgid;			/* Creator's group ID.  */
+  unsigned int mode;			/* Read/write permission.  */
+  unsigned short int __seq;		/* Sequence number.  */
+};
+
+
+/* The codes for the functions to use the ipc syscall multiplexer.  */
+#define IPCOP_semop	 1
+#define IPCOP_semget	 2
+#define IPCOP_semctl	 3
+#define IPCOP_semtimedop 4
+#define IPCOP_msgsnd	11
+#define IPCOP_msgrcv	12
+#define IPCOP_msgget	13
+#define IPCOP_msgctl	14
+#define IPCOP_shmat	21
+#define IPCOP_shmdt	22
+#define IPCOP_shmget	23
+#define IPCOP_shmctl	24

Modified: trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c
==============================================================================
--- trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c (original)
+++ trunk/libc/sysdeps/unix/sysv/linux/sparc/sparc64/wordexp.c Wed Dec 10 08:39:54 2008
@@ -1,1 +1,1 @@
-#include <sysdeps/unix/sysv/linux/alpha/wordexp.c>
+#include <sysdeps/unix/sysv/linux/ia64/wordexp.c>

Modified: trunk/ports/ChangeLog.arm
==============================================================================
--- trunk/ports/ChangeLog.arm (original)
+++ trunk/ports/ChangeLog.arm Wed Dec 10 08:39:54 2008
@@ -1,3 +1,15 @@
+2008-12-03  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h: Define
+	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.
+
+2008-11-25  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/sysdep.h (LOAD_ARGS_1, LOAD_ARGS_2,
+	LOAD_ARGS_3, LOAD_ARGS_4, LOAD_ARGS_5, LOAD_ARGS_6, LOAD_ARGS_7):
+	Load all arguments into temporary variables before loading into
+	registers.
+
 2008-08-19  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* data/c++-types-arm-linux-gnueabi.data: New.

Modified: trunk/ports/ChangeLog.mips
==============================================================================
--- trunk/ports/ChangeLog.mips (original)
+++ trunk/ports/ChangeLog.mips Wed Dec 10 08:39:54 2008
@@ -1,3 +1,18 @@
+2008-12-09  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/bits/socket.h (SCM_CREDENTIALS):
+	Make available only for __USE_GNU.
+
+2008-12-03  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h: Define
+	FUTEX_WAIT_BITSET and FUTEX_WAKE_BITSET.
+
+2008-11-25  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/mips/sys/signalfd.h (signalfd): Fix
+	__THROW vs. __nonnull order for C++.
+
 2008-10-15  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/mips/dl-dtprocnum.h (DT_MIPS_NUM): Do not redefine.

Modified: trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/arm/nptl/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -35,6 +35,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/bits/socket.h Wed Dec 10 08:39:54 2008
@@ -303,7 +303,7 @@
   {
     SCM_RIGHTS = 0x01		/* Transfer file descriptors.  */
 #define SCM_RIGHTS SCM_RIGHTS
-#ifdef __USE_BSD
+#ifdef __USE_GNU
     , SCM_CREDENTIALS = 0x02	/* Credentials passing.  */
 # define SCM_CREDENTIALS SCM_CREDENTIALS
 #endif

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/nptl/lowlevellock.h Wed Dec 10 08:39:54 2008
@@ -35,6 +35,8 @@
 #define FUTEX_LOCK_PI		6
 #define FUTEX_UNLOCK_PI		7
 #define FUTEX_TRYLOCK_PI	8
+#define FUTEX_WAIT_BITSET	9
+#define FUTEX_WAKE_BITSET	10
 #define FUTEX_PRIVATE_FLAG	128
 
 /* Values for 'private' parameter of locking macros.  Yes, the

Modified: trunk/ports/sysdeps/unix/sysv/linux/mips/sys/signalfd.h
==============================================================================
--- trunk/ports/sysdeps/unix/sysv/linux/mips/sys/signalfd.h (original)
+++ trunk/ports/sysdeps/unix/sysv/linux/mips/sys/signalfd.h Wed Dec 10 08:39:54 2008
@@ -59,7 +59,7 @@
 /* Request notification for delivery of signals in MASK to be
    performed using descriptor FD.*/
 extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
-  __nonnull ((2)) __THROW;
+  __THROW __nonnull ((2));
 
 __END_DECLS