This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.15-829-gf42d41d


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f42d41d10769f9bf465348e6cf6960364d47e10b (commit)
       via  3c3571fc107525cf3877ddd938e4d8f9b6526b6e (commit)
       via  61f06bd3ba0a5c95ca7261cacb13025fa30f10f4 (commit)
       via  918d4d716343a54ce97aefb13d20fa8f4e1d03de (commit)
       via  f34d6f840eaba45a82fa8d20922fc2d678968fb7 (commit)
       via  674cdbc7a3d022764e83b75e73b2767a36823c91 (commit)
       via  8e41b99fe1ae60276f8db4211d47ed2b1bacebf2 (commit)
       via  10589b4adb212dfde20670aacfb76aa842f42b92 (commit)
       via  63643c85d4c47512decc16f35124160629c39a86 (commit)
       via  3faebe6abc04ea8d632bee4537948ca85479c09a (commit)
       via  c6474b07e7b5f0cdc9089c1c4fcfc4fcaa2bcd92 (commit)
       via  1043890b10996ec4b14cd01040b82610760d5d4a (commit)
       via  37ed8b9bdc820a23d5884132d0278d9e42942fd3 (commit)
       via  b29d4053f0bda40f052cf69019e4198a21c67efb (commit)
       via  db65366043bd85adbf7b0a73f406f5dadbf5ceb3 (commit)
       via  ee16e894aaf51674058224fe0ece852bd0b3632d (commit)
       via  6103ae3b0eb1569cfdceb0e7c9625643b63dfd2a (commit)
       via  80b4e5f3ef231702b24d44c33e8dceb70abb3a06 (commit)
       via  edadcbd6247ca741756e234b6aa5f3db895bdd3d (commit)
       via  1792c087e53274678b4c638a54ca6b85182e51ca (commit)
       via  8069478040336a7de3461be275432493cc7e4c91 (commit)
       via  66cbbebcc616db8e221e81f7ecbb2c77701d031b (commit)
       via  6b645f0d702e9285f3d7fe5684258e77051cfa8e (commit)
       via  e468f8a3a7b10b9cecfc92a0c3090f25b42a56a6 (commit)
       via  a4186cffbfdb464ff1b7344fd7561d6014ef721e (commit)
       via  510bbf14b4f25fec8ee3a2d24de3f24bdbf84333 (commit)
       via  5d5722e8ac22253bdc819da2d676d9900da0c533 (commit)
       via  be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e (commit)
       via  37233df9d1fa7a1a6ff3a72ce4f642b1a96de9ca (commit)
       via  38de94a5efbc3de186d6f287d666f74e5b4c8247 (commit)
       via  bbc49098ff1bbbd5bdbcd69546b906d3844b4771 (commit)
       via  6753048948b86f3b045710f77e1616b348562fa9 (commit)
       via  18bad2ae1bd1797782d51231d24f7b773c2bfff6 (commit)
       via  5aa3a74a59916b489e9cf7c4dce9eb149e106c6c (commit)
       via  cd9fa98583b51812e906f1e85cc6e370bb4aff87 (commit)
       via  802ca5a5efa5d11836b2ffd81c9f6fd42f938ac6 (commit)
       via  ecd0de9a955fd14e825a666ea6785842e1579326 (commit)
       via  6960eb420d7b7cc18420dd68466b664867fa069d (commit)
       via  eb43375f0f7640a32fd6c67b94291419acb872d8 (commit)
       via  bcf5524012216fee3a7668a3b43aad3243a083b0 (commit)
       via  6178c55bdbb1e434b594e5f8563b6948f8f3edc0 (commit)
       via  6f080c2fcffac1bb8626b8d143dba57a37abb071 (commit)
       via  bcfe3a546e831ff3e43a8782f65a95fab7bb864d (commit)
      from  89c9aa491a7cee97bf78a29cddbf0a25c902a671 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f42d41d10769f9bf465348e6cf6960364d47e10b

commit f42d41d10769f9bf465348e6cf6960364d47e10b
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:55:50 2012 -0700

    Hurd: Define some posix types

diff --git a/ChangeLog b/ChangeLog
index fd5e9d3..a3b78b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* io/fcntl.h (mode_t, off_t, pid_t): Define types.
+	(__mode_t_defined, __off_t_defined, __pid_t_defined): Define macros.
+	* streams/stropts.h (t_scalar_t): Define type.
+
 	* sysdeps/generic/paths.h (_PATH_MAN): Set to "/usr/share/man"
 	(_PATH_PRESERVE): Set to "/var/lib".
 	(_PATH_RWHODIR): Set to "/var/spool/rwho".
diff --git a/io/fcntl.h b/io/fcntl.h
index 8b8726a..c7d5e69 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1992,1994-2001,2003-2007,2009-2011,2012
-	Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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,6 +31,29 @@ __BEGIN_DECLS
    numbers and flag bits for `open', `fcntl', et al.  */
 #include <bits/fcntl.h>
 
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
+/* The Single Unix specification says that some more types are
+   available here.  */
+# ifndef __mode_t_defined
+typedef __mode_t mode_t;
+#  define __mode_t_defined
+# endif
+
+# ifndef __off_t_defined
+#  ifndef __USE_FILE_OFFSET64
+typedef __off_t off_t;
+#  else
+typedef __off64_t off_t;
+#  endif
+#  define __off_t_defined
+# endif
+
+# ifndef __pid_t_defined
+typedef __pid_t pid_t;
+#  define __pid_t_defined
+# endif
+#endif	/* X/Open */
+
 /* For XPG all symbols from <sys/stat.h> should also be available.  */
 #if defined __USE_XOPEN || defined __USE_XOPEN2K8
 # include <bits/types.h>         /* For __mode_t and __dev_t.  */
diff --git a/streams/stropts.h b/streams/stropts.h
index 80fe460..fa67fef 100644
--- a/streams/stropts.h
+++ b/streams/stropts.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2000, 2002, 2003, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2012 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,6 +32,7 @@ typedef __uid_t uid_t;
 # define __uid_t_defined
 #endif
 
+typedef __t_scalar_t t_scalar_t;
 typedef __t_uscalar_t t_uscalar_t;
 
 /* Get system specific contants.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3c3571fc107525cf3877ddd938e4d8f9b6526b6e

commit 3c3571fc107525cf3877ddd938e4d8f9b6526b6e
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:55:06 2012 -0700

    Hurd: Fix paths in paths.h

diff --git a/ChangeLog b/ChangeLog
index 89a6ccf..fd5e9d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* sysdeps/generic/paths.h (_PATH_MAN): Set to "/usr/share/man"
+	(_PATH_PRESERVE): Set to "/var/lib".
+	(_PATH_RWHODIR): Set to "/var/spool/rwho".
+
 	* sysdeps/mach/hurd/openat.c (__openat): Set type of MODE to mode_t
 	instead of int.
 
diff --git a/sysdeps/generic/paths.h b/sysdeps/generic/paths.h
index 439992f..f85e88c 100644
--- a/sysdeps/generic/paths.h
+++ b/sysdeps/generic/paths.h
@@ -46,15 +46,15 @@
 #define	_PATH_DRUM	"/dev/drum"
 #define	_PATH_GSHADOW	"/etc/gshadow"
 #define	_PATH_KMEM	"/dev/kmem"
-#define	_PATH_MAILDIR	"/var/mail"
 #define	_PATH_LASTLOG	"/var/log/lastlog"
-#define	_PATH_MAN	"/usr/man"
+#define	_PATH_MAILDIR	"/var/mail"
+#define	_PATH_MAN	"/usr/share/man"
 #define	_PATH_MEM	"/dev/mem"
 #define	_PATH_MNTTAB    "/etc/fstab"
 #define	_PATH_MOUNTED   "/var/run/mtab"
 #define	_PATH_NOLOGIN	"/etc/nologin"
-#define	_PATH_PRESERVE	"/var/preserve"
-#define	_PATH_RWHODIR	"/var/rwho"
+#define	_PATH_PRESERVE	"/var/lib"
+#define	_PATH_RWHODIR	"/var/spool/rwho"
 #define	_PATH_SENDMAIL	"/usr/sbin/sendmail"
 #define	_PATH_SHADOW	"/etc/shadow"
 #define	_PATH_SHELLS	"/etc/shells"

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=61f06bd3ba0a5c95ca7261cacb13025fa30f10f4

commit 61f06bd3ba0a5c95ca7261cacb13025fa30f10f4
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:54:27 2012 -0700

    Hurd: fix mode type for openat

diff --git a/ChangeLog b/ChangeLog
index fa79b77..89a6ccf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* sysdeps/mach/hurd/openat.c (__openat): Set type of MODE to mode_t
+	instead of int.
+
 	* sysdeps/mach/hurd/xmknodat.c (__xmknodat): Deallocate NODE port only
 	if __dir_mkfile succeeded.
 
diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c
index 69d257c..c6fcf49 100644
--- a/sysdeps/mach/hurd/openat.c
+++ b/sysdeps/mach/hurd/openat.c
@@ -1,5 +1,5 @@
 /* openat -- Open a file named relative to an open directory.  Hurd version.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006-2012 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,14 +34,14 @@ __openat (fd, file, oflag)
      const char *file;
      int oflag;
 {
-  int mode;
+  mode_t mode;
   io_t port;
 
   if (oflag & O_CREAT)
     {
       va_list arg;
       va_start (arg, oflag);
-      mode = va_arg (arg, int);
+      mode = va_arg (arg, mode_t);
       va_end (arg);
     }
   else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=918d4d716343a54ce97aefb13d20fa8f4e1d03de

commit 918d4d716343a54ce97aefb13d20fa8f4e1d03de
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:52:43 2012 -0700

    Hurd: Fix port deallocation on mknod error.

diff --git a/ChangeLog b/ChangeLog
index d2174fe..fa79b77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* sysdeps/mach/hurd/xmknodat.c (__xmknodat): Deallocate NODE port only
+	if __dir_mkfile succeeded.
+
 	* sysdeps/mach/hurd/dup3.c: Lock _hurd_dtable_lock before
 	checking for _hurd_dtablesize.  Unlock it right after having
 	finished _hurd_dtable allocation.
diff --git a/sysdeps/mach/hurd/xmknodat.c b/sysdeps/mach/hurd/xmknodat.c
index acd1a8c..645f222 100644
--- a/sysdeps/mach/hurd/xmknodat.c
+++ b/sysdeps/mach/hurd/xmknodat.c
@@ -1,6 +1,5 @@
 /* Create a device file relative to an open directory.  Hurd version.
-   Copyright (C) 1991,1992,1993,1994,1995,1996,1999,2002,2005,2006
-	Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 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,7 +33,7 @@
 int
 __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
 {
-  error_t err;
+  error_t errnode, err;
   file_t dir, node;
   char *name;
   char buf[100], *bp;
@@ -94,7 +93,7 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
     return -1;
 
   /* Create a new, unlinked node in the target directory.  */
-  err = __dir_mkfile (dir, O_WRITE, (mode & ~S_IFMT) & ~_hurd_umask, &node);
+  errnode = err = __dir_mkfile (dir, O_WRITE, (mode & ~S_IFMT) & ~_hurd_umask, &node);
 
   if (! err && translator != NULL)
     /* Set the node's translator to make it a device.  */
@@ -109,7 +108,8 @@ __xmknodat (int vers, int fd, const char *path, mode_t mode, dev_t *dev)
     err = __dir_link (dir, node, name, 1);
 
   __mach_port_deallocate (__mach_task_self (), dir);
-  __mach_port_deallocate (__mach_task_self (), node);
+  if (! errnode)
+    __mach_port_deallocate (__mach_task_self (), node);
 
   if (err)
     return __hurd_fail (err);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f34d6f840eaba45a82fa8d20922fc2d678968fb7

commit f34d6f840eaba45a82fa8d20922fc2d678968fb7
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:49:30 2012 -0700

    Hurd: Fix __dup3 _hurd_dtable_lock usage.

diff --git a/ChangeLog b/ChangeLog
index 805aded..d2174fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/dup3.c: Lock _hurd_dtable_lock before
+	checking for _hurd_dtablesize.  Unlock it right after having
+	finished _hurd_dtable allocation.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* sysdeps/mach/hurd/configure.in: Remove warning for --prefix=[...].
diff --git a/sysdeps/mach/hurd/dup3.c b/sysdeps/mach/hurd/dup3.c
index 8a38caf..523ca42 100644
--- a/sysdeps/mach/hurd/dup3.c
+++ b/sysdeps/mach/hurd/dup3.c
@@ -71,15 +71,14 @@ __dup3 (int fd, int fd2, int flags)
 	  /* Get a hold of the destination descriptor.  */
 	  struct hurd_fd *d2;
 
+	  __mutex_lock (&_hurd_dtable_lock);
+
 	  if (fd2 >= _hurd_dtablesize)
 	    {
 	      /* The table is not large enough to hold the destination
 		 descriptor.  Enlarge it as necessary to allocate this
 		 descriptor.  */
 	      __mutex_unlock (&_hurd_dtable_lock);
-	      /* We still hold FD1's lock, but this is safe because
-		 _hurd_alloc_fd will only examine the cells starting
-		 at FD2.  */
 	      d2 = _hurd_alloc_fd (NULL, fd2);
 	      if (d2)
 		__spin_unlock (&d2->port.lock);
@@ -99,6 +98,7 @@ __dup3 (int fd, int fd2, int flags)
 							 MACH_PORT_NULL);
 		}
 	    }
+	  __mutex_unlock (&_hurd_dtable_lock);
 
 	  if (d2 == NULL)
 	    {
@@ -126,7 +126,6 @@ __dup3 (int fd, int fd2, int flags)
 	      _hurd_port_locked_set (&d2->port, port); /* Unlocks D2.  */
 	    }
 	}
-      __mutex_unlock (&_hurd_dtable_lock);
 
       _hurd_port_free (&d->port, &ulink, port);
       if (ctty != MACH_PORT_NULL)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=674cdbc7a3d022764e83b75e73b2767a36823c91

commit 674cdbc7a3d022764e83b75e73b2767a36823c91
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:46:14 2012 -0700

    Hurd: Support --prefix=/usr special-casing for all GNU systems.

diff --git a/ChangeLog b/ChangeLog
index 31c3362..805aded 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* sysdeps/mach/hurd/configure.in: Remove warning for --prefix=[...].
+	* sysdeps/mach/hurd/configure: Regenerated.
+	* sysdeps/unix/sysv/linux/configure.in: Move --prefix=/usr
+	special-casing to...
+	* sysdeps/gnu/configure.in: ... this new file.
+	* sysdeps/unix/sysv/linux/configure: Regenerated.
+	* sysdeps/gnu/configure: New generated file.
+
 	* sysdeps/mach/hurd/bits/stat.h (struct stat): Align to what is done
 	for Linux: use nsec instead of usec, as well as:
 	[__USE_MISC || __USE_XOPEN2K8] (st_atim, st_mtim, st_ctim): New
diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
new file mode 100644
index 0000000..634e1d0
--- /dev/null
+++ b/sysdeps/gnu/configure
@@ -0,0 +1,36 @@
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+
+# Local configure fragment for sysdeps/gnu.
+
+# The Filesystem Hierarchy Standard prescribes where to place "essential"
+# files.  I.e., when the installation prefix is "/usr" we have to place
+# shared library objects and the configuration files on the root partition
+# in /lib and /etc.
+case "$prefix" in
+/usr | /usr/)
+  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
+  # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
+  # and libc_cv_localedir.
+  test -n "$libc_cv_slibdir" || \
+  case $machine in
+  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
+    libc_cv_slibdir=/lib64
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib64';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_localedir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  *)
+    libc_cv_slibdir=/lib
+    ;;
+  esac
+  # Allow the user to override the path with --sysconfdir
+  if test "$sysconfdir" = '${prefix}/etc'; then
+    libc_cv_sysconfdir=/etc
+  else
+    libc_cv_sysconfdir=$sysconfdir
+   fi
+  libc_cv_rootsbindir=/sbin
+  ;;
+esac
diff --git a/sysdeps/gnu/configure.in b/sysdeps/gnu/configure.in
new file mode 100644
index 0000000..3422007
--- /dev/null
+++ b/sysdeps/gnu/configure.in
@@ -0,0 +1,36 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+
+# Local configure fragment for sysdeps/gnu.
+
+# The Filesystem Hierarchy Standard prescribes where to place "essential"
+# files.  I.e., when the installation prefix is "/usr" we have to place
+# shared library objects and the configuration files on the root partition
+# in /lib and /etc.
+case "$prefix" in
+/usr | /usr/)
+  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
+  # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
+  # and libc_cv_localedir.
+  test -n "$libc_cv_slibdir" || \
+  case $machine in
+  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
+    libc_cv_slibdir=/lib64
+    if test "$libdir" = '${exec_prefix}/lib'; then
+      libdir='${exec_prefix}/lib64';
+      # Locale data can be shared between 32bit and 64bit libraries
+      libc_cv_localedir='${exec_prefix}/lib/locale'
+    fi
+    ;;
+  *)
+    libc_cv_slibdir=/lib
+    ;;
+  esac
+  # Allow the user to override the path with --sysconfdir
+  if test "$sysconfdir" = '${prefix}/etc'; then
+    libc_cv_sysconfdir=/etc
+  else
+    libc_cv_sysconfdir=$sysconfdir
+   fi
+  libc_cv_rootsbindir=/sbin
+  ;;
+esac
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index ebf8bb0..3c90a66 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -1,22 +1,135 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
 
 # GNU libc on the Hurd is always reentrant.
 DEFINES="$DEFINES -D_LIBC_REENTRANT"
 
-cat >>confdefs.h <<\_ACEOF
-#define NO_HIDDEN 1
-_ACEOF
+$as_echo "#define NO_HIDDEN 1" >>confdefs.h
 
 
 # Don't bother trying to generate any glue code to be compatible with the
 # existing system library, because we are the only system library.
 inhibit_glue=yes
 
-if test "x$prefix" != x; then
-  { $as_echo "$as_me:$LINENO: WARNING: --prefix= (empty) is required for GNU/Hurd to work normally" >&5
-$as_echo "$as_me: WARNING: --prefix= (empty) is required for GNU/Hurd to work normally" >&2;}
-fi
-
 case "$machine" in
   i386*)
     # The default oldest ABI is 2.2.6.
@@ -28,16 +141,12 @@ case "$machine" in
 esac
 
 
-{ $as_echo "$as_me:$LINENO: checking Hurd header version" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5
 $as_echo_n "checking Hurd header version... " >&6; }
-if test "${libc_cv_hurd_version+set}" = set; then
+if ${libc_cv_hurd_version+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <hurd/version.h>
 int
@@ -52,38 +161,15 @@ main ()
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+if ac_fn_c_try_compile "$LINENO"; then :
   libc_cv_hurd_version=ok
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	libc_cv_hurd_version=bad
+  libc_cv_hurd_version=bad
 fi
-
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_hurd_version" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hurd_version" >&5
 $as_echo "$libc_cv_hurd_version" >&6; }
 if test "x$libc_cv_hurd_version" != xok; then
-  { { $as_echo "$as_me:$LINENO: error: Hurd headers not installed or too old" >&5
-$as_echo "$as_me: error: Hurd headers not installed or too old" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "Hurd headers not installed or too old" "$LINENO" 5
 fi
diff --git a/sysdeps/mach/hurd/configure.in b/sysdeps/mach/hurd/configure.in
index 87c07c1..6220142 100644
--- a/sysdeps/mach/hurd/configure.in
+++ b/sysdeps/mach/hurd/configure.in
@@ -10,10 +10,6 @@ AC_DEFINE([NO_HIDDEN])
 # existing system library, because we are the only system library.
 inhibit_glue=yes
 
-if test "x$prefix" != x; then
-  AC_MSG_WARN([--prefix= (empty) is required for GNU/Hurd to work normally])
-fi
-
 case "$machine" in
   i386*)
     # The default oldest ABI is 2.2.6.
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index 3103161..d571d0b 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -382,38 +382,6 @@ fi
 if test -n "$sysheaders"; then
   CPPFLAGS=$OLD_CPPFLAGS
 fi
-# The Linux filesystem standard prescribes where to place "essential"
-# files.  I.e., when the installation prefix is "/usr" we have to place
-# shared library objects and the configuration files on the root partition
-# in /lib and /etc.
-case "$prefix" in
-/usr | /usr/)
-  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
-  # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
-  # and libc_cv_localedir.
-  test -n "$libc_cv_slibdir" || \
-  case $machine in
-  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
-    libc_cv_slibdir="/lib64"
-    if test "$libdir" = '${exec_prefix}/lib'; then
-      libdir='${exec_prefix}/lib64';
-      # Locale data can be shared between 32bit and 64bit libraries
-      libc_cv_localedir='${exec_prefix}/lib/locale'
-    fi
-    ;;
-  *)
-    libc_cv_slibdir="/lib"
-    ;;
-  esac
-  # Allow the user to override the path with --sysconfdir
-  if test $sysconfdir = '${prefix}/etc'; then
-    libc_cv_sysconfdir=/etc
-  else
-    libc_cv_sysconfdir=$sysconfdir
-   fi
-  libc_cv_rootsbindir="/sbin"
-  ;;
-esac
 
 # Under Linux the NPTL add-on should be available.
 case $add_ons in
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 556ca84..916d64a 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -121,38 +121,6 @@ fi
 if test -n "$sysheaders"; then
   CPPFLAGS=$OLD_CPPFLAGS
 fi
-# The Linux filesystem standard prescribes where to place "essential"
-# files.  I.e., when the installation prefix is "/usr" we have to place
-# shared library objects and the configuration files on the root partition
-# in /lib and /etc.
-case "$prefix" in
-/usr | /usr/)
-  # 64-bit libraries on bi-arch platforms go in /lib64 instead of /lib.
-  # Allow earlier configure scripts to handle libc_cv_slibdir, libdir,
-  # and libc_cv_localedir.
-  test -n "$libc_cv_slibdir" || \
-  case $machine in
-  sparc/sparc64 | x86_64* | powerpc/powerpc64 | s390/s390-64)
-    libc_cv_slibdir="/lib64"
-    if test "$libdir" = '${exec_prefix}/lib'; then
-      libdir='${exec_prefix}/lib64';
-      # Locale data can be shared between 32bit and 64bit libraries
-      libc_cv_localedir='${exec_prefix}/lib/locale'
-    fi
-    ;;
-  *)
-    libc_cv_slibdir="/lib"
-    ;;
-  esac
-  # Allow the user to override the path with --sysconfdir
-  if test $sysconfdir = '${prefix}/etc'; then
-    libc_cv_sysconfdir=/etc
-  else
-    libc_cv_sysconfdir=$sysconfdir
-   fi
-  libc_cv_rootsbindir="/sbin"
-  ;;
-esac
 
 # Under Linux the NPTL add-on should be available.
 case $add_ons in

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8e41b99fe1ae60276f8db4211d47ed2b1bacebf2

commit 8e41b99fe1ae60276f8db4211d47ed2b1bacebf2
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:40:09 2012 -0700

    Hurd: struct timespec members in struct stat

diff --git a/ChangeLog b/ChangeLog
index 768fecd..31c3362 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* sysdeps/mach/hurd/bits/stat.h (struct stat): Align to what is done
+	for Linux: use nsec instead of usec, as well as:
+	[__USE_MISC || __USE_XOPEN2K8] (st_atim, st_mtim, st_ctim): New
+	members of type struct timespec.
+	[__USE_MISC || __USE_XOPEN2K8] (st_atime, st_mtime, st_ctime):
+	New macros.
+	(struct stat64): Likewise.
+	(_STATBUF_ST_NSEC): New macro.
+	* sysdeps/mach/hurd/xstatconv.c (xstat64_conv): Adapt to that.
+
 	* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Use
 	__strtoul_internal rather than strtoul.
 
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 15fcda1..e6ffda8 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992-1994,1996,1997,1999,2000,2005,2010
-   Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -58,12 +57,27 @@ struct stat
     __off64_t st_size;		/* Size in bytes.  */
 #endif
 
-    __time_t st_atime;		/* Access time, seconds */
-    unsigned long int st_atime_usec; /* and microseconds.  */
-    __time_t st_mtime;		/* Modification time, seconds */
-    unsigned long int st_mtime_usec; /* and microseconds.  */
-    __time_t st_ctime;		/* Status change time, seconds */
-    unsigned long int st_ctime_usec; /* and microseconds.  */
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+# define st_atime st_atim.tv_sec	/* Backward compatibility.  */
+# define st_mtime st_mtim.tv_sec
+# define st_ctime st_ctim.tv_sec
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
 
     __blksize_t st_blksize;	/* Optimal size for I/O.  */
 
@@ -107,12 +121,24 @@ struct stat64
 
     __off64_t st_size;		/* Size in bytes.  */
 
-    __time_t st_atime;		/* Access time, seconds */
-    unsigned long int st_atime_usec; /* and microseconds.  */
-    __time_t st_mtime;		/* Modification time, seconds */
-    unsigned long int st_mtime_usec; /* and microseconds.  */
-    __time_t st_ctime;		/* Status change time, seconds */
-    unsigned long int st_ctime_usec; /* and microseconds.  */
+#if defined __USE_MISC || defined __USE_XOPEN2K8
+    /* Nanosecond resolution timestamps are stored in a format
+       equivalent to 'struct timespec'.  This is the type used
+       whenever possible but the Unix namespace rules do not allow the
+       identifier 'timespec' to appear in the <sys/stat.h> header.
+       Therefore we have to handle the use of this header in strictly
+       standard-compliant sources special.  */
+    struct timespec st_atim;		/* Time of last access.  */
+    struct timespec st_mtim;		/* Time of last modification.  */
+    struct timespec st_ctim;		/* Time of last status change.  */
+#else
+    __time_t st_atime;			/* Time of last access.  */
+    unsigned long int st_atimensec;	/* Nscecs of last access.  */
+    __time_t st_mtime;			/* Time of last modification.  */
+    unsigned long int st_mtimensec;	/* Nsecs of last modification.  */
+    __time_t st_ctime;			/* Time of last status change.  */
+    unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
+#endif
 
     __blksize_t st_blksize;	/* Optimal size for I/O.  */
 
@@ -130,7 +156,10 @@ struct stat64
   };
 #endif
 
-#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
+/* Tell code we have these members.  */
+#define	_STATBUF_ST_BLKSIZE
+/* Nanosecond resolution time values are supported.  */
+#define _STATBUF_ST_NSEC
 
 /* Encoding of the file mode.  */
 
diff --git a/sysdeps/mach/hurd/xstatconv.c b/sysdeps/mach/hurd/xstatconv.c
index db704c6..ebe6471 100644
--- a/sysdeps/mach/hurd/xstatconv.c
+++ b/sysdeps/mach/hurd/xstatconv.c
@@ -1,5 +1,5 @@
 /* Convert between `struct stat' format, and `struct stat64' format.
-   Copyright (C) 2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 2000-2012 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
@@ -41,12 +41,9 @@ xstat64_conv (struct stat *buf, const struct stat64 *buf64)
   buf->st_uid = buf64->st_uid;
   buf->st_gid = buf64->st_gid;
   buf->st_size = buf64->st_size;
-  buf->st_atime = buf64->st_atime;
-  buf->st_atime_usec = buf64->st_atime_usec;
-  buf->st_mtime = buf64->st_mtime;
-  buf->st_mtime_usec = buf64->st_mtime_usec;
-  buf->st_ctime = buf64->st_ctime;
-  buf->st_ctime_usec = buf64->st_ctime_usec;
+  buf->st_atim = buf64->st_atim;
+  buf->st_mtim = buf64->st_mtim;
+  buf->st_ctim = buf64->st_ctim;
   buf->st_blksize = buf64->st_blksize;
   buf->st_blocks = buf64->st_blocks;
   buf->st_author = buf64->st_author;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=10589b4adb212dfde20670aacfb76aa842f42b92

commit 10589b4adb212dfde20670aacfb76aa842f42b92
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:37:23 2012 -0700

    Hurd: avoid PLT call to strtoul

diff --git a/ChangeLog b/ChangeLog
index b1dbcba..768fecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* hurd/lookup-retry.c (__hurd_file_name_lookup_retry): Use
+	__strtoul_internal rather than strtoul.
+
 2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
 
 	* hurd/hurdsock.c (_hurd_socket_server): Check for negative domains,
diff --git a/hurd/lookup-retry.c b/hurd/lookup-retry.c
index 3c506a0..4fa2a21 100644
--- a/hurd/lookup-retry.c
+++ b/hurd/lookup-retry.c
@@ -1,6 +1,5 @@
 /* hairy bits of Hurd file name lookup
-   Copyright (C) 1992,1993,1994,1995,1996,1997,1999,2001,2002,2003,2005
-	Free Software Foundation, Inc.
+   Copyright (C) 1992-2012 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
@@ -44,10 +43,10 @@ lookup_error (error_t error)
 
 error_t
 __hurd_file_name_lookup_retry (error_t (*use_init_port)
-			         (int which, error_t (*operate) (file_t)),
+				 (int which, error_t (*operate) (file_t)),
 			       file_t (*get_dtable_port) (int fd),
 			       error_t (*lookup)
-			         (file_t dir, char *name,
+				 (file_t dir, char *name,
 				  int flags, mode_t mode,
 				  retry_type *do_retry, string_t retry_name,
 				  mach_port_t *result),
@@ -193,7 +192,7 @@ __hurd_file_name_lookup_retry (error_t (*use_init_port)
 		  char *end;
 		  int save = errno;
 		  errno = 0;
-		  fd = (int) strtoul (&retryname[3], &end, 10);
+		  fd = (int) __strtoul_internal (&retryname[3], &end, 10, 0);
 		  if (end == NULL || errno || /* Malformed number.  */
 		      /* Check for excess text after the number.  A slash
 			 is valid; it ends the component.  Anything else

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=63643c85d4c47512decc16f35124160629c39a86

commit 63643c85d4c47512decc16f35124160629c39a86
Author: Pino Toscano <toscano.pino@tiscali.it>
Date:   Thu May 10 15:35:47 2012 -0700

    Hurd: hurdsock: reject negative domains

diff --git a/ChangeLog b/ChangeLog
index 6f59a1e..b1dbcba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
+
+	* hurd/hurdsock.c (_hurd_socket_server): Check for negative domains,
+	and reject them.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/setresgid.c (__setresgid): Handle the -1 case,
diff --git a/hurd/hurdsock.c b/hurd/hurdsock.c
index f3611ec..4b32ad4 100644
--- a/hurd/hurdsock.c
+++ b/hurd/hurdsock.c
@@ -1,5 +1,5 @@
 /* _hurd_socket_server - Find the server for a socket domain.
-   Copyright (C) 1991,92,93,94,95,97,99 Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 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
@@ -46,6 +46,12 @@ _hurd_socket_server (int domain, int dead)
 {
   socket_t server;
 
+  if (domain < 0)
+    {
+      errno = EAFNOSUPPORT;
+      return MACH_PORT_NULL;
+    }
+
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&lock);
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3faebe6abc04ea8d632bee4537948ca85479c09a

commit 3faebe6abc04ea8d632bee4537948ca85479c09a
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:34:53 2012 -0700

    Hurd: Fix setres[ug]id handling of -1

diff --git a/ChangeLog b/ChangeLog
index d244bdb..6f59a1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/setresgid.c (__setresgid): Handle the -1 case,
+	which preserves existing values.
+	* sysdeps/mach/hurd/setresuid.c (__setresuid): Likewise.
+
 2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
 
 	* hurd/hurdselect.c (_hurd_select): Return EINVAL for negative
diff --git a/sysdeps/mach/hurd/setresgid.c b/sysdeps/mach/hurd/setresgid.c
index 9d5885b..eebd364 100644
--- a/sysdeps/mach/hurd/setresgid.c
+++ b/sysdeps/mach/hurd/setresgid.c
@@ -1,5 +1,5 @@
 /* setresgid -- set real group ID, effective group ID, and saved-set group ID
-   Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 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,7 +28,6 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
 {
   auth_t newauth;
   error_t err;
-  gid_t agids[2] = { rgid, sgid };
 
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
@@ -37,31 +36,78 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid)
   if (!err)
     {
       /* Make a new auth handle which has EGID as the first element in the
-         list of effective gids.  */
+	 list of effective gids.  */
 
-      if (_hurd_id.gen.ngids > 0)
+      uid_t *newgen, *newaux;
+      uid_t auxs[2] = { rgid, sgid };
+      size_t ngen, naux;
+
+      newgen = _hurd_id.gen.gids;
+      ngen = _hurd_id.gen.ngids;
+      if (egid != -1)
+	{
+	  if (_hurd_id.gen.ngids == 0)
+	    {
+	      /* No effective gids now.  The new set will be just UID.  */
+	      newgen = &egid;
+	      ngen = 1;
+	    }
+	  else
+	    {
+	      _hurd_id.gen.gids[0] = egid;
+	      _hurd_id.valid = 0;
+	    }
+	}
+
+      newaux = _hurd_id.aux.gids;
+      naux = _hurd_id.aux.ngids;
+      if (rgid != -1)
 	{
-	  _hurd_id.gen.gids[0] = egid;
-	  _hurd_id.valid = 0;
+	  if (_hurd_id.aux.ngids == 0)
+	    {
+	      newaux = &rgid;
+	      naux = 1;
+	    }
+	  else
+	    {
+	      _hurd_id.aux.gids[0] = rgid;
+	      _hurd_id.valid = 0;
+	    }
 	}
-      if (_hurd_id.aux.ngids > 1)
+
+      if (sgid != -1)
 	{
-	  _hurd_id.aux.gids[0] = rgid;
-	  _hurd_id.aux.gids[1] = sgid;
-	  _hurd_id.valid = 0;
+	  if (rgid == -1)
+	    {
+	      if (_hurd_id.aux.ngids >= 1)
+		auxs[0] = _hurd_id.aux.gids[0];
+	      else if (_hurd_id.gen.ngids >= 1)
+		auxs[0] = _hurd_id.gen.gids[0];
+	      else
+		/* Not even an effective GID.
+                   Fall back to the only GID we have. */
+		auxs[0] = sgid;
+	    }
+	  if (_hurd_id.aux.ngids <= 1)
+	    {
+	      /* No saved gids now.  The new set will be just UID.  */
+	      newaux = auxs;
+	      naux = 2;
+	    }
+	  else
+	    {
+	      _hurd_id.aux.gids[1] = sgid;
+	      _hurd_id.valid = 0;
+	    }
 	}
 
       err = __USEPORT (AUTH, __auth_makeauth
 		       (port, NULL, MACH_MSG_TYPE_COPY_SEND, 0,
 			_hurd_id.gen.uids, _hurd_id.gen.nuids,
 			_hurd_id.aux.uids, _hurd_id.aux.nuids,
-			_hurd_id.gen.ngids ? _hurd_id.gen.gids : &egid,
-			_hurd_id.gen.ngids ?: 1,
-			_hurd_id.aux.ngids > 1 ? _hurd_id.aux.gids : agids,
-			_hurd_id.aux.ngids > 1 ? _hurd_id.aux.ngids : 2,
+			newgen, ngen, newaux, naux,
 			&newauth));
     }
-
   __mutex_unlock (&_hurd_id.lock);
   HURD_CRITICAL_END;
 
diff --git a/sysdeps/mach/hurd/setresuid.c b/sysdeps/mach/hurd/setresuid.c
index 35aea85..751763f 100644
--- a/sysdeps/mach/hurd/setresuid.c
+++ b/sysdeps/mach/hurd/setresuid.c
@@ -1,5 +1,5 @@
 /* setresuid -- set real user ID, effective user ID, and saved-set user ID
-   Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 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,7 +28,6 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
 {
   auth_t newauth;
   error_t err;
-  uid_t auids[2] = { ruid, suid };
 
   HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_id.lock);
@@ -37,26 +36,74 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid)
   if (!err)
     {
       /* Make a new auth handle which has EUID as the first element in the
-         list of effective uids.  */
+	 list of effective uids.  */
 
-      if (_hurd_id.gen.nuids > 0)
+      uid_t *newgen, *newaux;
+      uid_t auxs[2] = { ruid, suid };
+      size_t ngen, naux;
+
+      newgen = _hurd_id.gen.uids;
+      ngen = _hurd_id.gen.nuids;
+      if (euid != -1)
 	{
-	  _hurd_id.gen.uids[0] = euid;
-	  _hurd_id.valid = 0;
+	  if (_hurd_id.gen.nuids == 0)
+	    {
+	      /* No effective uids now.  The new set will be just UID.  */
+	      newgen = &euid;
+	      ngen = 1;
+	    }
+	  else
+	    {
+	      _hurd_id.gen.uids[0] = euid;
+	      _hurd_id.valid = 0;
+	    }
 	}
-      if (_hurd_id.aux.nuids > 1)
+
+      newaux = _hurd_id.aux.uids;
+      naux = _hurd_id.aux.nuids;
+      if (ruid != -1)
+	{
+	  if (_hurd_id.aux.nuids == 0)
+	    {
+	      newaux = &ruid;
+	      naux = 1;
+	    }
+	  else
+	    {
+	      _hurd_id.aux.uids[0] = ruid;
+	      _hurd_id.valid = 0;
+	    }
+	}
+
+      if (suid != -1)
 	{
-	  _hurd_id.aux.uids[0] = ruid;
-	  _hurd_id.aux.uids[1] = suid;
-	  _hurd_id.valid = 0;
+	  if (ruid == -1)
+	    {
+	      if (_hurd_id.aux.nuids >= 1)
+		auxs[0] = _hurd_id.aux.uids[0];
+	      else if (_hurd_id.gen.nuids >= 1)
+		auxs[0] = _hurd_id.gen.uids[0];
+	      else
+		/* Not even an effective UID.
+                   Fall back to the only UID we have. */
+		auxs[0] = suid;
+	    }
+	  if (_hurd_id.aux.nuids <= 1)
+	    {
+	      /* No saved uids now.  The new set will be just UID.  */
+	      newaux = auxs;
+	      naux = 2;
+	    }
+	  else
+	    {
+	      _hurd_id.aux.uids[1] = suid;
+	      _hurd_id.valid = 0;
+	    }
 	}
 
       err = __USEPORT (AUTH, __auth_makeauth
 		       (port, NULL, MACH_MSG_TYPE_COPY_SEND, 0,
-			_hurd_id.gen.nuids ? _hurd_id.gen.uids : &euid,
-			_hurd_id.gen.nuids ?: 1,
-			_hurd_id.aux.nuids > 1 ? _hurd_id.aux.uids : auids,
-			_hurd_id.aux.nuids > 1 ? _hurd_id.aux.nuids : 2,
+			newgen, ngen, newaux, naux,
 			_hurd_id.gen.gids, _hurd_id.gen.ngids,
 			_hurd_id.aux.gids, _hurd_id.aux.ngids,
 			&newauth));

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c6474b07e7b5f0cdc9089c1c4fcfc4fcaa2bcd92

commit c6474b07e7b5f0cdc9089c1c4fcfc4fcaa2bcd92
Author: Pino Toscano <toscano.pino@tiscali.it>
Date:   Thu May 10 15:32:53 2012 -0700

    Hurd: _hurd_select: check for invalid parameter values

diff --git a/ChangeLog b/ChangeLog
index 11fdd81..d244bdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
+
+	* hurd/hurdselect.c (_hurd_select): Return EINVAL for negative
+	TIMEOUT values.  Return EINVAL for NFDS values either negative or
+	greater than FD_SETSIZE.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/brk.c (_hurd_set_brk): When more space needs to be
diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c
index 25d9d9f..21ba5f4 100644
--- a/hurd/hurdselect.c
+++ b/hurd/hurdselect.c
@@ -1,6 +1,5 @@
 /* Guts of both `select' and `poll' for Hurd.
-   Copyright (C) 1991,92,93,94,95,96,97,98,99,2001
-   	Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 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
@@ -49,10 +48,7 @@ _hurd_select (int nfds,
   error_t err;
   fd_set rfds, wfds, xfds;
   int firstfd, lastfd;
-  mach_msg_timeout_t to = (timeout != NULL ?
-			   (timeout->tv_sec * 1000 +
-			    (timeout->tv_nsec + 999999) / 1000000) :
-			   0);
+  mach_msg_timeout_t to = 0;
   struct
     {
       struct hurd_userlink ulink;
@@ -71,6 +67,24 @@ _hurd_select (int nfds,
   assert (sizeof (union typeword) == sizeof (mach_msg_type_t));
   assert (sizeof (uint32_t) == sizeof (mach_msg_type_t));
 
+  if (nfds < 0 || nfds > FD_SETSIZE)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  if (timeout != NULL)
+    {
+      if (timeout->tv_sec < 0 || timeout->tv_nsec < 0)
+	{
+	  errno = EINVAL;
+	  return -1;
+	}
+
+      to = (timeout->tv_sec * 1000 +
+            (timeout->tv_nsec + 999999) / 1000000);
+    }
+
   if (sigmask && __sigprocmask (SIG_SETMASK, sigmask, &oset))
     return -1;
 
@@ -364,7 +378,7 @@ _hurd_select (int nfds,
 		}
 
 	      /* Look up the respondent's reply port and record its
-                 readiness.  */
+		 readiness.  */
 	      {
 		int had = got;
 		if (firstfd != -1)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1043890b10996ec4b14cd01040b82610760d5d4a

commit 1043890b10996ec4b14cd01040b82610760d5d4a
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:31:37 2012 -0700

    Hurd: Fix sbrk beyond 128MB

diff --git a/ChangeLog b/ChangeLog
index ac0ad18..11fdd81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/brk.c (_hurd_set_brk): When more space needs to be
+	allocated, call __vm_protect to finish enabling the existing space, and
+	pass a copy of _hurd_data_end instead of PAGEBRK to __vm_allocate to
+	allocate the remainder.
+
 2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
 
 	* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Check also for a null
diff --git a/sysdeps/mach/hurd/brk.c b/sysdeps/mach/hurd/brk.c
index 275d7be..1900277 100644
--- a/sysdeps/mach/hurd/brk.c
+++ b/sysdeps/mach/hurd/brk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,99,2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -63,7 +63,7 @@ weak_alias (__brk, brk)
 int
 _hurd_set_brk (vm_address_t addr)
 {
-  error_t err;
+  error_t err = 0;
   vm_address_t pagend = round_page (addr);
   vm_address_t pagebrk = round_page (_hurd_brk);
   long int rlimit;
@@ -100,8 +100,22 @@ _hurd_set_brk (vm_address_t addr)
 
   if (pagend > _hurd_data_end)
     {
+      vm_address_t alloc_start = _hurd_data_end;
+
       /* We didn't allocate enough space!  Hopefully we can get some more!  */
-      err = __vm_allocate (__mach_task_self (), &pagebrk, pagend - pagebrk, 0);
+
+      if (_hurd_data_end > pagebrk)
+	/* First finish allocation.  */
+	err = __vm_protect (__mach_task_self (), pagebrk,
+			    alloc_start - pagebrk, 0,
+			    VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE);
+      if (! err)
+	_hurd_brk = alloc_start;
+
+      if (! err)
+	err = __vm_allocate (__mach_task_self (), &alloc_start,
+			     pagend - alloc_start, 0);
+
       if (! err)
 	_hurd_data_end = pagend;
     }

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37ed8b9bdc820a23d5884132d0278d9e42942fd3

commit 37ed8b9bdc820a23d5884132d0278d9e42942fd3
Author: Pino Toscano <toscano.pino@tiscali.it>
Date:   Thu May 10 15:30:38 2012 -0700

    Hurd: recvfrom(): take into account null address ports

diff --git a/ChangeLog b/ChangeLog
index 1591ca9..ac0ad18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
+2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
+
+	* sysdeps/mach/hurd/recvfrom.c (__recvfrom): Check also for a null
+	address port.  Set ADDR_LEN to 0 when not filling ADDRARG.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-        * sysdeps/mach/hurd/readlinkat.c: New file, heavily derived from
-        sysdeps/mach/hurd/readlink.c.
+	* sysdeps/mach/hurd/readlinkat.c: New file, heavily derived from
+	sysdeps/mach/hurd/readlink.c.
 
 	* posix/tst-sysconf.c (posix_options): Only use
 	_POSIX_PRIORITIZED_IO, _POSIX_PRIORITY_SCHEDULING, and
diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c
index f591336..3a094aa 100644
--- a/sysdeps/mach/hurd/recvfrom.c
+++ b/sysdeps/mach/hurd/recvfrom.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 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
@@ -54,7 +54,7 @@ __recvfrom (fd, buf, n, flags, addrarg, addr_len)
     return __hurd_sockfail (fd, flags, err);
 
   /* Get address data for the returned address port if requested.  */
-  if (addr != NULL)
+  if (addr != NULL && addrport != MACH_PORT_NULL)
     {
       char *buf = (char *) addr;
       mach_msg_type_number_t buflen = *addr_len;
@@ -88,6 +88,8 @@ __recvfrom (fd, buf, n, flags, addrarg, addr_len)
       if (buflen > 0)
 	addr->sa_family = type;
     }
+  else if (addr_len != NULL)
+    *addr_len = 0;
 
   __mach_port_deallocate (__mach_task_self (), addrport);
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b29d4053f0bda40f052cf69019e4198a21c67efb

commit b29d4053f0bda40f052cf69019e4198a21c67efb
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:29:55 2012 -0700

    Hurd: readlinkat

diff --git a/ChangeLog b/ChangeLog
index aee2aa5..1591ca9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+        * sysdeps/mach/hurd/readlinkat.c: New file, heavily derived from
+        sysdeps/mach/hurd/readlink.c.
+
 	* posix/tst-sysconf.c (posix_options): Only use
 	_POSIX_PRIORITIZED_IO, _POSIX_PRIORITY_SCHEDULING, and
 	_POSIX_SYNCHRONIZED_IO when they are defined
@@ -16,8 +19,6 @@
 	(_POSIX_PRIORITIZED_IO): Undefine macro.
 	(_POSIX_SPIN_LOCKS): Define macro to -1.
 
-2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
-
 	* bits/sigaction.h [__USE_XOPEN2K8]: Define SA_RESTART,
 	SA_NODEFER, SA_RESETHAND.
 	* sysdeps/mach/hurd/bits/fcntl.h [__USE_XOPEN2K8]: Define
diff --git a/sysdeps/mach/hurd/readlinkat.c b/sysdeps/mach/hurd/readlinkat.c
new file mode 100644
index 0000000..b70f9c8
--- /dev/null
+++ b/sysdeps/mach/hurd/readlinkat.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 1991-2012 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 <unistd.h>
+#include <hurd.h>
+#include <hurd/paths.h>
+#include <hurd/fd.h>
+#include <fcntl.h>
+#include <string.h>
+
+/* Read the contents of the symbolic link FILE_NAME relative to FD into no more
+   than LEN bytes of BUF.  The contents are not null-terminated.
+   Returns the number of characters read, or -1 for errors.  */
+ssize_t
+readlinkat (fd, file_name, buf, len)
+     int fd;
+     const char *file_name;
+     char *buf;
+     size_t len;
+{
+  error_t err;
+  file_t file;
+  struct stat64 st;
+
+  file = __file_name_lookup_at (fd, 0, file_name, O_READ | O_NOLINK, 0);
+  if (file == MACH_PORT_NULL)
+    return -1;
+
+  err = __io_stat (file, &st);
+  if (! err)
+    if (S_ISLNK (st.st_mode))
+      {
+	char *rbuf = buf;
+
+	err = __io_read (file, &rbuf, &len, 0, len);
+	if (!err && rbuf != buf)
+	  {
+	    memcpy (buf, rbuf, len);
+	    __vm_deallocate (__mach_task_self (), (vm_address_t)rbuf, len);
+	  }
+      }
+    else
+      err = EINVAL;
+
+  __mach_port_deallocate (__mach_task_self (), file);
+
+  return err ? __hurd_fail (err) : len;
+}
+libc_hidden_def (readlinkat)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=db65366043bd85adbf7b0a73f406f5dadbf5ceb3

commit db65366043bd85adbf7b0a73f406f5dadbf5ceb3
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:28:33 2012 -0700

    Hurd: Update posix_opt.h

diff --git a/ChangeLog b/ChangeLog
index 2dcbfd5..aee2aa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,23 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* posix/tst-sysconf.c (posix_options): Only use
+	_POSIX_PRIORITIZED_IO, _POSIX_PRIORITY_SCHEDULING, and
+	_POSIX_SYNCHRONIZED_IO when they are defined
+	* sysdeps/mach/hurd/bits/posix_opt.h:
+	(_POSIX_PRIORITY_SCHEDULING): Undefine macro.
+	(_XOPEN_REALTIME): Undefine macro.
+	(_XOPEN_REALTIME_THREADS): Undefine macro.
+	(_XOPEN_SHM): Undefine macro.
+	[__USE_XOPEN2K8] (_POSIX_THREAD_ROBUST_PRIO_INHERIT): Define
+	macro to -1.
+	[__USE_XOPEN2K8] (_POSIX_THREAD_ROBUST_PRIO_PROTECT): Define
+	macro to -1.
+	(_POSIX_ASYNC_IO): Undefine macro.
+	(_POSIX_PRIORITIZED_IO): Undefine macro.
+	(_POSIX_SPIN_LOCKS): Define macro to -1.
+
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
 	* bits/sigaction.h [__USE_XOPEN2K8]: Define SA_RESTART,
 	SA_NODEFER, SA_RESETHAND.
 	* sysdeps/mach/hurd/bits/fcntl.h [__USE_XOPEN2K8]: Define
diff --git a/posix/tst-sysconf.c b/posix/tst-sysconf.c
index e297229..105c7c2 100644
--- a/posix/tst-sysconf.c
+++ b/posix/tst-sysconf.c
@@ -29,8 +29,12 @@ static struct
     N (MEMORY_PROTECTION),
     N (MESSAGE_PASSING),
     N (MONOTONIC_CLOCK),
+#ifdef _POSIX_PRIORITIZED_IO
     N (PRIORITIZED_IO),
+#endif
+#ifdef _POSIX_PRIORITY_SCHEDULING
     N (PRIORITY_SCHEDULING),
+#endif
     N (RAW_SOCKETS),
     N (READER_WRITER_LOCKS),
     N (REALTIME_SIGNALS),
@@ -42,7 +46,9 @@ static struct
     N (SPAWN),
     N (SPIN_LOCKS),
     N (SPORADIC_SERVER),
+#ifdef _POSIX_SYNCHRONIZED_IO
     N (SYNCHRONIZED_IO),
+#endif
     N (THREAD_ATTR_STACKADDR),
     N (THREAD_ATTR_STACKSIZE),
     N (THREAD_CPUTIME),
diff --git a/sysdeps/mach/hurd/bits/posix_opt.h b/sysdeps/mach/hurd/bits/posix_opt.h
index 23d32ce..3c08307 100644
--- a/sysdeps/mach/hurd/bits/posix_opt.h
+++ b/sysdeps/mach/hurd/bits/posix_opt.h
@@ -1,5 +1,5 @@
 /* Define POSIX options for GNU/Hurd.
-   Copyright (C) 1998,2000,2001,2002,2006,2009 Free Software Foundation, Inc.
+   Copyright (C) 1998-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,6 +30,9 @@
 /* Processes have a saved set-user-ID and a saved set-group-ID.  */
 #define	_POSIX_SAVED_IDS	1
 
+/* Priority scheduling is not supported.  */
+#undef	_POSIX_PRIORITY_SCHEDULING
+
 /* Synchronizing file data is supported, but msync is missing.  */
 #undef _POSIX_SYNCHRONIZED_IO
 
@@ -59,6 +62,14 @@
 #undef _POSIX_NO_TRUNC		/* Overlong file names get error?  */
 #undef _POSIX_SYNC_IO		/* File supports O_SYNC et al?  */
 
+/* X/Open realtime support is not supported.  */
+#undef _XOPEN_REALTIME
+
+/* X/Open thread realtime support is not supported.  */
+#undef _XOPEN_REALTIME_THREADS
+
+/* XPG4.2 shared memory is not supported.  */
+#undef	_XOPEN_SHM
 
 /* We do not have the POSIX threads interface.  */
 #define _POSIX_THREADS	-1
@@ -71,6 +82,12 @@
 #define _POSIX_THREAD_PRIORITY_SCHEDULING	-1
 #define _POSIX_THREAD_ATTR_STACKSIZE		-1
 #define _POSIX_THREAD_ATTR_STACKADDR		-1
+#define _POSIX_THREAD_PRIO_INHERIT		-1
+#define _POSIX_THREAD_PRIO_PROTECT		-1
+#ifdef __USE_XOPEN2K8
+# define _POSIX_THREAD_ROBUST_PRIO_INHERIT	-1
+# define _POSIX_THREAD_ROBUST_PRIO_PROTECT	-1
+#endif
 #define _POSIX_SEMAPHORES			-1
 
 /* Real-time signals are not yet supported.  */
@@ -78,8 +95,11 @@
 
 /* Asynchronous I/O might supported with the existing ABI.  */
 #define _POSIX_ASYNCHRONOUS_IO	0
+#undef _POSIX_ASYNC_IO
 /* Alternative name for Unix98.  */
 #define _LFS_ASYNCHRONOUS_IO	_POSIX_ASYNCHRONOUS_IO
+/* Support for prioritization is not available.  */
+#undef _POSIX_PRIORITIZED_IO
 
 /* The LFS support in asynchronous I/O is also available.  */
 #define _LFS64_ASYNCHRONOUS_IO	_POSIX_ASYNCHRONOUS_IO
@@ -110,6 +130,9 @@
 /* We cannot support the Timeouts option without _POSIX_THREADS.  */
 #define _POSIX_TIMEOUTS	-1
 
+/* We do not support spinlocks.  */
+#define _POSIX_SPIN_LOCKS	-1
+
 /* The `spawn' function family is supported.  */
 #define _POSIX_SPAWN	200809L
 
@@ -156,9 +179,4 @@
 /* Typed memory objects are not available.  */
 #define _POSIX_TYPED_MEMORY_OBJECTS	-1
 
-/* No support for priority inheritance or protection so far.  */
-#define _POSIX_THREAD_PRIO_INHERIT	-1
-#define _POSIX_THREAD_PRIO_PROTECT	-1
-
-
 #endif /* bits/posix_opt.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ee16e894aaf51674058224fe0ece852bd0b3632d

commit ee16e894aaf51674058224fe0ece852bd0b3632d
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:27:04 2012 -0700

    Hurd: Fix POSIX 2008 visibility

diff --git a/ChangeLog b/ChangeLog
index fd2752f..2dcbfd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* bits/sigaction.h [__USE_XOPEN2K8]: Define SA_RESTART,
+	SA_NODEFER, SA_RESETHAND.
+	* sysdeps/mach/hurd/bits/fcntl.h [__USE_XOPEN2K8]: Define
+	O_NOFOLLOW, O_DIRECTORY, O_CLOEXEC, F_GETOWN, F_SETOWN,
+	F_DUPFD_CLOEXEC.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* elf/Makefile (pldd-modules): Define unconditionally.
diff --git a/bits/sigaction.h b/bits/sigaction.h
index a5e1d18..a737660 100644
--- a/bits/sigaction.h
+++ b/bits/sigaction.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,96,97,98,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -54,6 +54,8 @@ struct sigaction
 /* Bits in `sa_flags'.  */
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
+#endif
+#if defined __USE_UNIX98 || defined __USE_MISC || defined __USE_XOPEN2K8
 # define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
 # define SA_NODEFER	0x0010	/* Don't automatically block the signal when
 				    its handler is being executed.  */
diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h
index 4224bf1..1d24c73 100644
--- a/sysdeps/mach/hurd/bits/fcntl.h
+++ b/sysdeps/mach/hurd/bits/fcntl.h
@@ -1,6 +1,5 @@
 /* O_*, F_*, FD_* bit values for GNU.
-   Copyright (C) 1993,1994,1996,1997,1998,1999,2000,2001,2004,2007
-	Free Software Foundation, Inc.
+   Copyright (C) 1993-2012 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
@@ -54,7 +53,9 @@
 #ifdef __USE_GNU
 # define O_NOLINK	0x0040	/* No name mappings on final component.  */
 # define O_NOTRANS	0x0080	/* No translator on final component. */
+#endif
 
+#ifdef __USE_XOPEN2K8
 # define O_NOFOLLOW	0x00100000 /* Produce ENOENT if file is a symlink.  */
 # define O_DIRECTORY	0x00200000 /* Produce ENOTDIR if not a directory.  */
 #endif
@@ -118,7 +119,7 @@
    once the file has been opened.  */
 
 #define	O_TRUNC		0x00010000 /* Truncate file to zero length.  */
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define O_CLOEXEC	0x00400000 /* Set FD_CLOEXEC.  */
 #endif
 
@@ -158,7 +159,7 @@
 #define	F_SETFD		2	/* Set file descriptor flags.  */
 #define	F_GETFL		3	/* Get file status flags.  */
 #define	F_SETFL		4	/* Set file status flags.  */
-#if defined __USE_BSD || defined __USE_UNIX98
+#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K8
 # define F_GETOWN	5	/* Get owner (receiver of SIGIO).  */
 # define F_SETOWN	6	/* Set owner (receiver of SIGIO).  */
 #endif
@@ -166,7 +167,7 @@
 #define	F_SETLK		8	/* Set record locking info (non-blocking).  */
 #define	F_SETLKW	9	/* Set record locking info (blocking).  */
 
-#ifdef __USE_GNU
+#ifdef __USE_XOPEN2K8
 # define F_DUPFD_CLOEXEC 1030	/* Duplicate, set FD_CLOEXEC on new one.  */
 #endif
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6103ae3b0eb1569cfdceb0e7c9625643b63dfd2a

commit 6103ae3b0eb1569cfdceb0e7c9625643b63dfd2a
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:26:10 2012 -0700

    Hurd: Build pldd also if use-ldconfig != yes || build-shared != yes

diff --git a/ChangeLog b/ChangeLog
index 22b2605..fd2752f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* elf/Makefile (pldd-modules): Define unconditionally.
+
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
 	* sysdeps/mach/hurd/opendir.c (__opendirat): New function.
 
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
diff --git a/elf/Makefile b/elf/Makefile
index 8743ee0..f6c6fb4 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -80,15 +80,14 @@ install-rootsbin += ldconfig
 
 ldconfig-modules := cache readlib xmalloc xstrdup chroot_canon
 extra-objs	+= $(ldconfig-modules:=.o)
+endif
+endif
 
 pldd-modules := xmalloc
 
 # To find xmalloc.c and xstrdup.c
 vpath %.c ../locale/programs
 
-endif
-endif
-
 ifeq ($(have-ksh)$(build-shared),yesyes)
 extra-objs += sotruss-lib.os sotruss-lib.so
 install-others += $(inst_auditdir)/sotruss-lib.so

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=80b4e5f3ef231702b24d44c33e8dceb70abb3a06

commit 80b4e5f3ef231702b24d44c33e8dceb70abb3a06
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:23:51 2012 -0700

    Hurd: opendirat

diff --git a/ChangeLog b/ChangeLog
index 739ee96..22b2605 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* sysdeps/mach/hurd/opendir.c (__opendirat): New function.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* hurd/hurdchdir.c (_hurd_change_directory_port_from_name):
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index c71cb18..1759444 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <hurd.h>
 #include <hurd/fd.h>
+#include <not-cancel.h>
 #include "dirstream.h"
 
 
@@ -67,10 +68,45 @@ _hurd_fd_opendir (struct hurd_fd *d)
 }
 
 
+DIR *
+internal_function
+__opendirat (int dfd, const char *name)
+{
+  if (name[0] == '\0')
+    {
+      /* POSIX.1-1990 says an empty name gets ENOENT;
+	 but `open' might like it fine.  */
+      __set_errno (ENOENT);
+      return NULL;
+    }
+
+  int flags = O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC;
+  int fd;
+#ifdef IS_IN_rtld
+  assert (dfd == AT_FDCWD);
+  fd = open_not_cancel_2 (name, flags);
+#else
+  fd = openat_not_cancel_3 (dfd, name, flags);
+#endif
+  if (fd < 0)
+    return NULL;
+
+  /* Extract the pointer to the descriptor structure.  */
+  DIR *dirp = _hurd_fd_opendir (_hurd_fd_get (fd));
+  if (dirp == NULL)
+    __close (fd);
+
+  return dirp;
+}
+
+
 /* Open a directory stream on NAME.  */
 DIR *
 __opendir (const char *name)
 {
+#if 0 /* TODO.  */
+  return __opendirat (AT_FDCWD, name);
+#else
   if (name[0] == '\0')
     {
       /* POSIX.1-1990 says an empty name gets ENOENT;
@@ -89,5 +125,6 @@ __opendir (const char *name)
     __close (fd);
 
   return dirp;
+#endif
 }
 weak_alias (__opendir, opendir)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=edadcbd6247ca741756e234b6aa5f3db895bdd3d

commit edadcbd6247ca741756e234b6aa5f3db895bdd3d
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:21:18 2012 -0700

    Hurd: empty file names fail with ENOENT

diff --git a/ChangeLog b/ChangeLog
index 1371751..739ee96 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* hurd/hurdchdir.c (_hurd_change_directory_port_from_name):
+	Return ENOENT when name is empty.
+	* sysdeps/mach/hurd/chroot.c (chroot): Likewise.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* include/libc-symbols.h [NO_HIDDEN] (hidden_nolink): New macro.
diff --git a/hurd/hurdchdir.c b/hurd/hurdchdir.c
index 6881956..1669358 100644
--- a/hurd/hurdchdir.c
+++ b/hurd/hurdchdir.c
@@ -1,5 +1,5 @@
 /* Change a port cell to a directory by looking up a name.
-   Copyright (C) 1999,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1999-2012 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,6 +37,9 @@ _hurd_change_directory_port_from_name (struct hurd_port *portcell,
   len = strlen (name);
   if (len >= 2 && name[len - 2] == '/' && name[len - 1] == '.')
     lookup = name;
+  else if (len == 0)
+    /* Special-case empty file name according to POSIX.  */
+    return __hurd_fail (ENOENT);
   else
     {
       char *n = alloca (len + 3);
diff --git a/sysdeps/mach/hurd/chroot.c b/sysdeps/mach/hurd/chroot.c
index 1a6b1e4..95bee33 100644
--- a/sysdeps/mach/hurd/chroot.c
+++ b/sysdeps/mach/hurd/chroot.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,95,97,99,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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,6 +37,9 @@ chroot (const char *path)
   len = strlen (path);
   if (len >= 2 && path[len - 2] == '/' && path[len - 1] == '.')
     lookup = path;
+  else if (len == 0)
+    /* Special-case empty file name according to POSIX.  */
+    return __hurd_fail (ENOENT);
   else
     {
       char *n = alloca (len + 3);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1792c087e53274678b4c638a54ca6b85182e51ca

commit 1792c087e53274678b4c638a54ca6b85182e51ca
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:19:24 2012 -0700

    Hurd: hidden_nolink macro for NO_HIDDEN case.

diff --git a/ChangeLog b/ChangeLog
index 04f67f0..1371751 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* include/libc-symbols.h [NO_HIDDEN] (hidden_nolink): New macro.
+
 	* nss/makedb.c (MAP_POPULATE): If not defined, define to zero.
 
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 0c3274e..12b3639 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -1,7 +1,6 @@
 /* Support macros for making weak and strong aliases for symbols,
    and for using symbol sets and linker warnings with GNU ld.
-   Copyright (C) 1995-1998,2000-2006,2008,2009,2011,2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 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
@@ -550,6 +549,7 @@ for linking")
 # define hidden_data_weak(name)
 # define hidden_data_def(name)
 # define hidden_data_ver(local, name)
+# define hidden_nolink(name, lib, version)
 #endif
 
 #if !defined NOT_IN_libc

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8069478040336a7de3461be275432493cc7e4c91

commit 8069478040336a7de3461be275432493cc7e4c91
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:17:40 2012 -0700

    Hurd: mmap deficiencies

diff --git a/ChangeLog b/ChangeLog
index e52cd67..04f67f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,12 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* nss/makedb.c (MAP_POPULATE): If not defined, define to zero.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-        Fix mlock in all cases except non-readable pages.
-        * sysdeps/mach/hurd/mlock.c (mlock): Give VM_PROT_READ
-        instead of VM_PROT_ALL as parameter to __vm_wire function.
+	Fix mlock in all cases except non-readable pages.
+	* sysdeps/mach/hurd/mlock.c (mlock): Give VM_PROT_READ
+	instead of VM_PROT_ALL as parameter to __vm_wire function.
 
 	* sysdeps/mach/hurd/mkdir.c: Include <string.h>.
 	(__mkdir): When path is `/', just fail with EEXIST.
diff --git a/nss/makedb.c b/nss/makedb.c
index 5c073a7..5890c05 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -48,6 +48,10 @@
 # include <selinux/selinux.h>
 #endif
 
+#ifndef MAP_POPULATE
+# define MAP_POPULATE 0
+#endif
+
 #define PACKAGE _libc_intl_domainname
 
 /* List of data bases.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=66cbbebcc616db8e221e81f7ecbb2c77701d031b

commit 66cbbebcc616db8e221e81f7ecbb2c77701d031b
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:17:03 2012 -0700

    Hurd: Fix mlock in all cases except non-readable pages.

diff --git a/ChangeLog b/ChangeLog
index b48d9e5..e52cd67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+        Fix mlock in all cases except non-readable pages.
+        * sysdeps/mach/hurd/mlock.c (mlock): Give VM_PROT_READ
+        instead of VM_PROT_ALL as parameter to __vm_wire function.
+
 	* sysdeps/mach/hurd/mkdir.c: Include <string.h>.
 	(__mkdir): When path is `/', just fail with EEXIST.
 	* sysdeps/mach/hurd/mkdirat.c: Likewise.
diff --git a/sysdeps/mach/hurd/mlock.c b/sysdeps/mach/hurd/mlock.c
index 2cb3e56..47bafaa 100644
--- a/sysdeps/mach/hurd/mlock.c
+++ b/sysdeps/mach/hurd/mlock.c
@@ -1,5 +1,5 @@
 /* mlock -- guarantee pages are resident in memory.  Mach/Hurd version.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2012 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
@@ -39,7 +39,7 @@ mlock (const void *addr, size_t len)
   page = trunc_page ((vm_address_t) addr);
   len = round_page ((vm_address_t) addr + len) - page;
   err = __vm_wire (hostpriv, __mach_task_self (), page, len,
-		   VM_PROT_ALL); /* XXX ? */
+		   VM_PROT_READ);
   __mach_port_deallocate (__mach_task_self (), hostpriv);
 
   return err ? __hurd_fail (err) : 0;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6b645f0d702e9285f3d7fe5684258e77051cfa8e

commit 6b645f0d702e9285f3d7fe5684258e77051cfa8e
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 15:16:07 2012 -0700

    Hurd: Fix mkdir / error value

diff --git a/ChangeLog b/ChangeLog
index 9a62ca4..b48d9e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/mkdir.c: Include <string.h>.
+	(__mkdir): When path is `/', just fail with EEXIST.
+	* sysdeps/mach/hurd/mkdirat.c: Likewise.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* nss/makedb.c: Include <sys/param.h> (for MAX and roundup), and
diff --git a/sysdeps/mach/hurd/mkdir.c b/sysdeps/mach/hurd/mkdir.c
index d3627ee..8ad648e 100644
--- a/sysdeps/mach/hurd/mkdir.c
+++ b/sysdeps/mach/hurd/mkdir.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,93,94,95,96,97,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <sys/stat.h>
 #include <hurd.h>
+#include <string.h>
 
 /* Create a directory named FILE_NAME with protections MODE.  */
 int
@@ -28,7 +29,10 @@ __mkdir (file_name, mode)
 {
   error_t err;
   const char *name;
-  file_t parent = __directory_name_split (file_name, (char **) &name);
+  file_t parent;
+  if (!strcmp (file_name, "/"))
+    return __hurd_fail (EEXIST);
+  parent = __directory_name_split (file_name, (char **) &name);
   if (parent == MACH_PORT_NULL)
     return -1;
   err = __dir_mkdir (parent, name, mode & ~_hurd_umask);
diff --git a/sysdeps/mach/hurd/mkdirat.c b/sysdeps/mach/hurd/mkdirat.c
index 9201f7d..d6d672e 100644
--- a/sysdeps/mach/hurd/mkdirat.c
+++ b/sysdeps/mach/hurd/mkdirat.c
@@ -1,6 +1,5 @@
 /* Create a directory named relative to another open directory.  Hurd version.
-   Copyright (C) 1991,1993,1994,1995,1996,1997,2002,2006
-	Free Software Foundation, Inc.
+   Copyright (C) 1991-2012 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,6 +21,7 @@
 #include <sys/stat.h>
 #include <hurd.h>
 #include <hurd/fd.h>
+#include <string.h>
 
 int
 mkdirat (fd, path, mode)
@@ -31,7 +31,10 @@ mkdirat (fd, path, mode)
 {
   error_t err;
   const char *name;
-  file_t parent = __directory_name_split_at (fd, path, (char **) &name);
+  file_t parent;
+  if (!strcmp (path, "/"))
+    return __hurd_fail (EEXIST);
+  parent = __directory_name_split_at (fd, path, (char **) &name);
   if (parent == MACH_PORT_NULL)
     return -1;
   err = __dir_mkdir (parent, name, mode & ~_hurd_umask);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e468f8a3a7b10b9cecfc92a0c3090f25b42a56a6

commit e468f8a3a7b10b9cecfc92a0c3090f25b42a56a6
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 15:13:54 2012 -0700

    Hurd: Add missing includes

diff --git a/ChangeLog b/ChangeLog
index c568aec..9a62ca4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* nss/makedb.c: Include <sys/param.h> (for MAX and roundup), and
+	<sys/uio.h> (for writev).
+	* nss/nss_db/db-initgroups.c: Include <limits.h> (for ULONG_MAX),
+	and <sys/param.h> (for MIN).
+
 2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
 
 	* sysdeps/mach/nanosleep.c: Return EINVAL for invalid values of
diff --git a/nss/makedb.c b/nss/makedb.c
index d4ac16e..5c073a7 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -1,5 +1,5 @@
 /* Create simple DB database from textual input.
-   Copyright (C) 1996-2000, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -32,7 +32,9 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
+#include <sys/param.h>
 #include <sys/stat.h>
+#include <sys/uio.h>
 #include "nss_db/nss_db.h"
 
 /* Get libc version number.  */
diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c
index e56f58a..16eb8e2 100644
--- a/nss/nss_db/db-initgroups.c
+++ b/nss/nss_db/db-initgroups.c
@@ -20,8 +20,10 @@
 #include <ctype.h>
 #include <errno.h>
 #include <grp.h>
+#include <limits.h>
 #include <paths.h>
 #include <string.h>
+#include <sys/param.h>
 
 #include "nss_db.h"
 

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a4186cffbfdb464ff1b7344fd7561d6014ef721e

commit a4186cffbfdb464ff1b7344fd7561d6014ef721e
Author: Pino Toscano <toscano.pino@tiscali.it>
Date:   Thu May 10 14:53:21 2012 -0700

    Hurd: mach: compliance fixes for nanosleep

diff --git a/ChangeLog b/ChangeLog
index 456c632..c568aec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Pino Toscano  <toscano.pino@tiscali.it>
+
+	* sysdeps/mach/nanosleep.c: Return EINVAL for invalid values of
+	REQUESTED_TIME.  Properly set the remaining time and return EINTR
+	if interrupted.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* sysdeps/mach/hurd/Makefile ($(common-objpfx)linkobj/libc.so):
@@ -5,13 +11,13 @@
 
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-        * sysdeps/generic/ldsodefs.h [LIBC_STACK_END_NOT_RELRO]
-        (__libc_stack_end): Do not use attribute_relro.
-        * sysdeps/mach/hurd/dl-sysdep.h (LIBC_STACK_END_NOT_RELRO): Define.
-        * sysdeps/mach/hurd/i386/init-first.c (init): Update __libc_stack_end
+	* sysdeps/generic/ldsodefs.h [LIBC_STACK_END_NOT_RELRO]
+	(__libc_stack_end): Do not use attribute_relro.
+	* sysdeps/mach/hurd/dl-sysdep.h (LIBC_STACK_END_NOT_RELRO): Define.
+	* sysdeps/mach/hurd/i386/init-first.c (init): Update __libc_stack_end
 	to libthread-provided value.
-        * sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Do not use
-        attribute_relro.
+	* sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Do not use
+	attribute_relro.
 
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
@@ -36,7 +42,7 @@
 
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-        * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Use common exit
+	* sysdeps/mach/hurd/setitimer.c (setitimer_locked): Use common exit
 	path instead of returning without unlocking.
 
 	* sysdeps/mach/hurd/bits/ioctls.h (_IOIW): New macro for
@@ -63,16 +69,16 @@
 
 	* sysdeps/mach/hurd/dl-sysdep.c: Conditionalize contents on [SHARED].
 
-        * hurd/hurd/fd.h (_hurd_fd_get): Call HURD_CRITICAL_BEGIN/
-        HURD_CRITICAL_END around holding _hurd_dtable_lock.
-        * sysdeps/mach/hurd/dirfd (dirfd): Likewise.
-        * sysdeps/mach/hurd/opendir.c (_hurd_fd_opendir): Call
-        HURD_CRITICAL_BEGIN/HURD_CRITICAL_END around holding
-        d->port.lock.
+	* hurd/hurd/fd.h (_hurd_fd_get): Call HURD_CRITICAL_BEGIN/
+	HURD_CRITICAL_END around holding _hurd_dtable_lock.
+	* sysdeps/mach/hurd/dirfd (dirfd): Likewise.
+	* sysdeps/mach/hurd/opendir.c (_hurd_fd_opendir): Call
+	HURD_CRITICAL_BEGIN/HURD_CRITICAL_END around holding
+	d->port.lock.
 
-        * hurd/catch-signal.c (hurd_catch_signal): Use sigsetjmp/siglongjmp
-        instead of setjmp/longjmp to restore the signal mask.  Call sigsetjmp
-        when handler == SIG_ERR, not when handler != SIG_ERR.
+	* hurd/catch-signal.c (hurd_catch_signal): Use sigsetjmp/siglongjmp
+	instead of setjmp/longjmp to restore the signal mask.  Call sigsetjmp
+	when handler == SIG_ERR, not when handler != SIG_ERR.
 
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
@@ -95,7 +101,7 @@
 
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-        * bits/in.h (SOL_IP, SOL_IPV6, SOL_ICMPV6): New macros.
+	* bits/in.h (SOL_IP, SOL_IPV6, SOL_ICMPV6): New macros.
 
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
diff --git a/sysdeps/mach/nanosleep.c b/sysdeps/mach/nanosleep.c
index 0192ff0..a1ba19c 100644
--- a/sysdeps/mach/nanosleep.c
+++ b/sysdeps/mach/nanosleep.c
@@ -1,5 +1,5 @@
 /* nanosleep -- sleep for a period specified with a struct timespec
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 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
@@ -27,6 +27,15 @@ __nanosleep (const struct timespec *requested_time,
 {
   mach_port_t recv;
   struct timeval before, after;
+
+  if (requested_time->tv_sec < 0
+      || requested_time->tv_nsec < 0
+      || requested_time->tv_nsec >= 1000000000)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
   const mach_msg_timeout_t ms
     = requested_time->tv_sec * 1000
     + (requested_time->tv_nsec + 999999) / 1000000;
@@ -35,16 +44,22 @@ __nanosleep (const struct timespec *requested_time,
 
   if (remaining && __gettimeofday (&before, NULL) < 0)
     return -1;
-  (void) __mach_msg (NULL, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT,
-		     0, 0, recv, ms, MACH_PORT_NULL);
+  error_t err = __mach_msg (NULL, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT,
+			    0, 0, recv, ms, MACH_PORT_NULL);
   __mach_port_destroy (mach_task_self (), recv);
-  if (remaining && __gettimeofday (&after, NULL) < 0)
-    return -1;
-
-  if (remaining)
+  if (err == EMACH_RCV_INTERRUPTED)
     {
-      timersub (&after, &before, &after);
-      TIMEVAL_TO_TIMESPEC (&after, remaining);
+      if (remaining && __gettimeofday (&after, NULL) >= 0)
+	{
+	  struct timeval req_time, elapsed, rem;
+	  TIMESPEC_TO_TIMEVAL (&req_time, requested_time);
+	  timersub (&after, &before, &elapsed);
+	  timersub (&req_time, &elapsed, &rem);
+	  TIMEVAL_TO_TIMESPEC (&rem, remaining);
+	}
+
+      errno = EINTR;
+      return -1;
     }
 
   return 0;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=510bbf14b4f25fec8ee3a2d24de3f24bdbf84333

commit 510bbf14b4f25fec8ee3a2d24de3f24bdbf84333
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 14:52:03 2012 -0700

    Hurd: Include RPC user stubs in linkobj/libc.so

diff --git a/ChangeLog b/ChangeLog
index 1ae3593..456c632 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* sysdeps/mach/hurd/Makefile ($(common-objpfx)linkobj/libc.so):
+	Depend on against $(link-rpcuserlibs).
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
         * sysdeps/generic/ldsodefs.h [LIBC_STACK_END_NOT_RELRO]
diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
index 80749c2..107eaaf 100644
--- a/sysdeps/mach/hurd/Makefile
+++ b/sysdeps/mach/hurd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1993-2004,2009,2011,2012 Free Software Foundation, Inc.
+# Copyright (C) 1993-2012 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
@@ -133,6 +133,7 @@ rpcuserlibs := $(common-objpfx)mach/libmachuser.so \
 	       $(common-objpfx)hurd/libhurduser.so
 link-rpcuserlibs := $(rpcuserlibs:%user.so=%user-link.so)
 $(common-objpfx)libc.so: $(link-rpcuserlibs)
+$(common-objpfx)linkobj/libc.so: $(link-rpcuserlibs)
 rpath-dirs += mach hurd
 
 # Make sure the `lib' pass builds the dummy shared objects so

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5d5722e8ac22253bdc819da2d676d9900da0c533

commit 5d5722e8ac22253bdc819da2d676d9900da0c533
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 14:51:22 2012 -0700

    Hurd: Fix value of __libc_stack_end

diff --git a/ChangeLog b/ChangeLog
index fea15ee..1ae3593 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+        * sysdeps/generic/ldsodefs.h [LIBC_STACK_END_NOT_RELRO]
+        (__libc_stack_end): Do not use attribute_relro.
+        * sysdeps/mach/hurd/dl-sysdep.h (LIBC_STACK_END_NOT_RELRO): Define.
+        * sysdeps/mach/hurd/i386/init-first.c (init): Update __libc_stack_end
+	to libthread-provided value.
+        * sysdeps/mach/hurd/dl-sysdep.c (__libc_stack_end): Do not use
+        attribute_relro.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	[BZ #3748]
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 602b429..e071015 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -717,7 +717,11 @@ rtld_hidden_proto (_dl_make_stack_executable)
    might use the variable which results in copy relocations on some
    platforms.  But this does not matter, ld.so can always use the local
    copy.  */
-extern void *__libc_stack_end attribute_relro;
+extern void *__libc_stack_end
+#ifndef LIBC_STACK_END_NOT_RELRO
+     attribute_relro
+#endif
+     ;
 rtld_hidden_proto (__libc_stack_end)
 
 /* Parameters passed to the dynamic linker.  */
diff --git a/sysdeps/mach/hurd/dl-sysdep.h b/sysdeps/mach/hurd/dl-sysdep.h
index 671b241..c64a39d 100644
--- a/sysdeps/mach/hurd/dl-sysdep.h
+++ b/sysdeps/mach/hurd/dl-sysdep.h
@@ -1,5 +1,5 @@
 /* System-specific settings for dynamic linker code.  Hurd version.
-   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 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,8 @@
 #define RTLD_PRIVATE_ERRNO 0
 
 #ifdef SHARED
-/* _dl_argv cannot be attribute_relro, because the stack-switching
+/* _dl_argv and __libc_stack_end cannot be attribute_relro, because the stack-switching
    libc initializer for using cthreads might write into it.  */
 # define DL_ARGV_NOT_RELRO 1
+# define LIBC_STACK_END_NOT_RELRO 1
 #endif
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index f4bf624..fa4e3d9 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -214,6 +214,8 @@ init (int *data)
 
       void switch_stacks (void);
 
+      __libc_stack_end = newsp;
+
       /* Copy per-thread variables from that temporary
 	 area onto the new cthread stack.  */
       memcpy (__hurd_threadvar_location_from_sp (0, newsp),

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e

commit be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 14:50:14 2012 -0700

    Hurd: libc_once_get

diff --git a/ChangeLog b/ChangeLog
index 279fbd6..fea15ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	[BZ #3748]
+	* bits/libc-lock.h (__libc_once_get): New macro.
+	* sysdeps/mach/bits/libc-lock.h: Likewise.
+	* sysdeps/mach/hurd/bits/libc-lock.h: Likewise.
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): Use __libc_once_get
+	instead of using implementation details.
+
 	* libio/fileops.c: Unconditionally include <kernel-features.h>.
 	* libio/freopen.c: Likewise.
 	* libio/freopen64.c: Likewise.
diff --git a/bits/libc-lock.h b/bits/libc-lock.h
index 4f0029f..d7c49e7 100644
--- a/bits/libc-lock.h
+++ b/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Stub version.
-   Copyright (C) 1996,97,99,2000-2002,2003 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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,6 +97,9 @@
     }									      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL) \
+  ((ONCE_CONTROL) == 1)
 
 /* Start a critical region with a cleanup function */
 #define __libc_cleanup_region_start(DOIT, FCT, ARG)			    \
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 7e17ca0..905a6be 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	[BZ #3748]
+	* sysdeps/pthread/bits/libc-lockP.h (__libc_once_get): New macro.
+
 2012-05-09  Chung-Lin Tang  <cltang@codesourcery.com>
 
 	* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S
diff --git a/nptl/sysdeps/pthread/bits/libc-lockP.h b/nptl/sysdeps/pthread/bits/libc-lockP.h
index d08fb9d..0ebac91 100644
--- a/nptl/sysdeps/pthread/bits/libc-lockP.h
+++ b/nptl/sysdeps/pthread/bits/libc-lockP.h
@@ -257,6 +257,8 @@ typedef pthread_key_t __libc_key_t;
     }									      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL) != PTHREAD_ONCE_INIT)
 
 /* Note that for I/O cleanup handling we are using the old-style
    cancel handling.  It does not have to be integrated with C++ snce
diff --git a/sysdeps/mach/bits/libc-lock.h b/sysdeps/mach/bits/libc-lock.h
index 0a627e7..110e25e 100644
--- a/sysdeps/mach/bits/libc-lock.h
+++ b/sysdeps/mach/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Mach cthreads version.
-   Copyright (C) 1996,97,98,2000,01, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -115,6 +115,9 @@ struct __libc_once
     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL).done != 0)
+
 #ifdef _LIBC
 /* We need portable names for some functions.  E.g., when they are
    used as argument to __libc_cleanup_region_start.  */
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h
index af531da..d18a10c 100644
--- a/sysdeps/mach/hurd/bits/libc-lock.h
+++ b/sysdeps/mach/hurd/bits/libc-lock.h
@@ -1,5 +1,5 @@
 /* libc-internal interface for mutex locks.  Hurd version using Mach cthreads.
-   Copyright (C) 1996,97,98,2000,01, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -187,6 +187,9 @@ struct __libc_once
     __libc_lock_unlock (ONCE_CONTROL.lock);				      \
   } while (0)
 
+/* Get once control variable.  */
+#define __libc_once_get(ONCE_CONTROL)	((ONCE_CONTROL).done != 0)
+
 #ifdef _LIBC
 /* We need portable names for some functions.  E.g., when they are
    used as argument to __libc_cleanup_region_start.  */
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 1a023f9..2eca2ae 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2604,7 +2604,7 @@ getaddrinfo (const char *name, const char *service,
 	  __libc_lock_define_initialized (static, lock);
 
 	  __libc_lock_lock (lock);
-	  if (old_once && gaiconf_reload_flag)
+	  if (__libc_once_get (old_once) && gaiconf_reload_flag)
 	    gaiconf_reload ();
 	  qsort_r (order, nresults, sizeof (order[0]), rfc3484_sort, &src);
 	  __libc_lock_unlock (lock);

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=37233df9d1fa7a1a6ff3a72ce4f642b1a96de9ca

commit 37233df9d1fa7a1a6ff3a72ce4f642b1a96de9ca
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 14:39:53 2012 -0700

    Hurd: #include <kernel-features.h>

diff --git a/ChangeLog b/ChangeLog
index 5e71ac6..279fbd6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* libio/fileops.c: Unconditionally include <kernel-features.h>.
+	* libio/freopen.c: Likewise.
+	* libio/freopen64.c: Likewise.
+	* misc/syslog.c: Likewise.
+	* nscd/connections.c: Likewise.
+	* nscd/netgroupcache.c: Likewise.
+	* sysdeps/posix/getcwd.c: Likewise.
+
 2012-05-10  Roland McGrath  <roland@hack.frob.com>
 
 	* math/w_ilogbf.c: Add #include <limits.h>.
diff --git a/libio/fileops.c b/libio/fileops.c
index a2e8dac..93750f8 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007, 2008, 2009, 2011-2012
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
@@ -46,6 +45,7 @@
 # include "../iconv/gconv_int.h"
 # include <shlib-compat.h>
 # include <not-cancel.h>
+# include <kernel-features.h>
 #endif
 #ifndef errno
 extern int errno;
diff --git a/libio/freopen.c b/libio/freopen.c
index 418f412..025c55b 100644
--- a/libio/freopen.c
+++ b/libio/freopen.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,95,96,97,98,2000,2001,2002,2003,2008,2011
-	Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 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 +33,8 @@
 #include <shlib-compat.h>
 #include <fd_to_filename.h>
 
+#include <kernel-features.h>
+
 FILE*
 freopen (filename, mode, fp)
      const char* filename;
diff --git a/libio/freopen64.c b/libio/freopen64.c
index 7e1beef..24d0360 100644
--- a/libio/freopen64.c
+++ b/libio/freopen64.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1995,1996,1997,1998,2000,2001,2002, 2003, 2008, 2011
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 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
@@ -33,6 +32,8 @@
 
 #include <fd_to_filename.h>
 
+#include <kernel-features.h>
+
 FILE *
 freopen64 (filename, mode, fp)
      const char* filename;
diff --git a/misc/syslog.c b/misc/syslog.c
index 57d4db9..4e18883 100644
--- a/misc/syslog.c
+++ b/misc/syslog.c
@@ -56,6 +56,8 @@ static char sccsid[] = "@(#)syslog.c	8.4 (Berkeley) 3/18/94";
 #include <libio/iolibio.h>
 #include <math_ldbl_opt.h>
 
+#include <kernel-features.h>
+
 #define ftell(s) INTUSE(_IO_ftell) (s)
 
 static int	LogType = SOCK_DGRAM;	/* type of socket connection */
diff --git a/nscd/connections.c b/nscd/connections.c
index a8f287e..77b9ac4 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1,5 +1,5 @@
 /* Inner loops of cache daemon.
-   Copyright (C) 1998-2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1998-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -56,9 +56,8 @@
 #include "dbg_log.h"
 #include "selinux.h"
 #include <resolv/resolv.h>
-#ifdef HAVE_SENDFILE
-# include <kernel-features.h>
-#endif
+
+#include <kernel-features.h>
 
 
 /* Support to run nscd as an unprivileged user */
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
index 276e66f..70cf9c1 100644
--- a/nscd/netgroupcache.c
+++ b/nscd/netgroupcache.c
@@ -1,5 +1,5 @@
 /* Cache handling for netgroup lookup.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
 
@@ -27,9 +27,8 @@
 #include "../inet/netgroup.h"
 #include "nscd.h"
 #include "dbg_log.h"
-#ifdef HAVE_SENDFILE
-# include <kernel-features.h>
-#endif
+
+#include <kernel-features.h>
 
 
 /* This is the standard reply in case the service is disabled.  */
diff --git a/sysdeps/posix/getcwd.c b/sysdeps/posix/getcwd.c
index 6c41977..1dc45e8 100644
--- a/sysdeps/posix/getcwd.c
+++ b/sysdeps/posix/getcwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999,2011-2012 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -173,6 +173,7 @@ extern char *alloca ();
 
 #if defined _LIBC
 # include <not-cancel.h>
+# include <kernel-features.h>
 #else
 # define openat64_not_cancel_3(dfd, name, mode) openat64 (dfd, name, mode)
 # define close_not_cancel_no_status(fd) close (fd)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=38de94a5efbc3de186d6f287d666f74e5b4c8247

commit 38de94a5efbc3de186d6f287d666f74e5b4c8247
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu May 10 14:38:43 2012 -0700

    Add a missing #include.

diff --git a/ChangeLog b/ChangeLog
index e49be8d..5e71ac6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-10  Roland McGrath  <roland@hack.frob.com>
+
+	* math/w_ilogbf.c: Add #include <limits.h>.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
         * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Use common exit
diff --git a/math/w_ilogbf.c b/math/w_ilogbf.c
index ae3574a..27a0c58 100644
--- a/math/w_ilogbf.c
+++ b/math/w_ilogbf.c
@@ -18,6 +18,7 @@
 
 #include <math.h>
 #include <errno.h>
+#include <limits.h>
 #include <math_private.h>
 
 /* wrapper ilogbf */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bbc49098ff1bbbd5bdbcd69546b906d3844b4771

commit bbc49098ff1bbbd5bdbcd69546b906d3844b4771
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 13:33:47 2012 -0700

    Hurd: setitimer.c: Fix unlock in error patch

diff --git a/ChangeLog b/ChangeLog
index b373406..e49be8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+        * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Use common exit
+	path instead of returning without unlocking.
+
 	* sysdeps/mach/hurd/bits/ioctls.h (_IOIW): New macro for
 	immediate-write ioctls.
 	* sysdeps/mach/hurd/ioctl.c: Handle cases with no arguments.
diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c
index a7b2e29..00cd0cc 100644
--- a/sysdeps/mach/hurd/setitimer.c
+++ b/sysdeps/mach/hurd/setitimer.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1994,1995,1996,1997,2000,2001,2005
-	Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 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
@@ -219,7 +218,7 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old,
 	  /* Start up the itimer thread running `timer_thread' (below).  */
 	  if (err = __thread_create (__mach_task_self (),
 				     &_hurd_itimer_thread))
-	    return __hurd_fail (err);
+	    goto out;
 	  _hurd_itimer_thread_stack_base = 0; /* Anywhere.  */
 	  _hurd_itimer_thread_stack_size = __vm_page_size; /* Small stack.  */
 	  if (err = __mach_setup_thread (__mach_task_self (),

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6753048948b86f3b045710f77e1616b348562fa9

commit 6753048948b86f3b045710f77e1616b348562fa9
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 13:26:40 2012 -0700

    Hurd: ioctl() incorrectly decodes argument

diff --git a/ChangeLog b/ChangeLog
index e399542..b373406 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/bits/ioctls.h (_IOIW): New macro for
+	immediate-write ioctls.
+	* sysdeps/mach/hurd/ioctl.c: Handle cases with no arguments.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* sysdeps/mach/hurd/i386/init-first.c (init): Use
diff --git a/sysdeps/mach/hurd/bits/ioctls.h b/sysdeps/mach/hurd/bits/ioctls.h
index 65f2ec1..c4cfce6 100644
--- a/sysdeps/mach/hurd/bits/ioctls.h
+++ b/sysdeps/mach/hurd/bits/ioctls.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,93,96,97,98,99,2001,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -157,6 +157,7 @@ enum __ioctl_datum { IOC_8, IOC_16, IOC_32, IOC_64 };
    _IOT_foobar is defined either in this file,
    or where struct foobar is defined.  */
 #define	_IO(g, n)	_IOC (IOC_VOID, (g), (n), 0)
+#define	_IOIW(g, n, t)	_IOC (IOC_VOID, (g), (n), _IOC_ENCODE_TYPE (t))
 #define	_IOR(g, n, t)	_IOC (IOC_OUT, (g), (n), _IOC_ENCODE_TYPE (t))
 #define	_IOW(g, n, t)	_IOC (IOC_IN, (g), (n), _IOC_ENCODE_TYPE (t))
 #define	_IOWR(g, n, t)	_IOC (IOC_INOUT, (g), (n), _IOC_ENCODE_TYPE (t))
diff --git a/sysdeps/mach/hurd/ioctl.c b/sysdeps/mach/hurd/ioctl.c
index beffe43..543d437 100644
--- a/sysdeps/mach/hurd/ioctl.c
+++ b/sysdeps/mach/hurd/ioctl.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1992,93,94,95,96,97,99,2000,2002,2005
-	Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -88,7 +87,7 @@ __ioctl (int fd, unsigned long int request, ...)
   void *p;
 #endif
 
-  void *arg;
+  void *arg = NULL;
 
   error_t err;
 
@@ -111,7 +110,7 @@ __ioctl (int fd, unsigned long int request, ...)
       if (_IOC_INOUT (request) & IOC_IN)
 	{
 	  /* We don't want to advance ARG since it will be used to copy out
-             too if IOC_OUT is also set.  */
+	     too if IOC_OUT is also set.  */
 	  void *argptr = arg;
 
 	  /* Pack an argument into the message buffer.  */
@@ -139,7 +138,7 @@ __ioctl (int fd, unsigned long int request, ...)
 	  in (_IOT_COUNT1 (type), _IOT_TYPE1 (type));
 	  in (_IOT_COUNT2 (type), _IOT_TYPE2 (type));
 	}
-      else if (_IOC_INOUT (request) == IOC_VOID)
+      else if (_IOC_INOUT (request) == IOC_VOID && _IOT_COUNT0 (type) != 0)
 	{
 	  /* The RPC takes a single integer_t argument.
 	     Rather than pointing to the value, ARG is the value itself.  */
@@ -208,11 +207,15 @@ __ioctl (int fd, unsigned long int request, ...)
       return msg.header.RetCode;
     }
 
-  va_list ap;
+  if (_IOT_COUNT0 (type) != 0)
+    {
+      /* Data need either be sent, received, or even both.  */
+      va_list ap;
 
-  va_start (ap, request);
-  arg = va_arg (ap, void *);
-  va_end (ap);
+      va_start (ap, request);
+      arg = va_arg (ap, void *);
+      va_end (ap);
+    }
 
   {
     /* Check for a registered handler for REQUEST.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=18bad2ae1bd1797782d51231d24f7b773c2bfff6

commit 18bad2ae1bd1797782d51231d24f7b773c2bfff6
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 13:20:47 2012 -0700

    Hurd: Avoid init-first.c miscompilation.

diff --git a/ChangeLog b/ChangeLog
index 9e747cd..e399542 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* sysdeps/mach/hurd/i386/init-first.c (init): Use
+	__builtin_frame_address instead of making assumptions about the
+	location of the return address relative to DATA.  Force early load of
+	the return address.
+	(_dl_init_first, doinit1 in doinit in _hurd_stack_setup): Don't use
+	__builtin_frame_address.
+
 	dup3 for GNU Hurd.
 	* include/unistd.h: Declare __dup3 and use libc_hidden_proto on it.
 	* sysdeps/mach/hurd/dup3.c: New file, copy from dup2.c.  Evolve it to
diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index 4785e8d..f4bf624 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -122,7 +122,7 @@ init1 (int argc, char *arg0, ...)
     {
 #ifndef SHARED
       /* We may need to see our own phdrs, e.g. for TLS setup.
-         Try the usual kludge to find the headers without help from
+	 Try the usual kludge to find the headers without help from
 	 the exec server.  */
       extern const void _start;
       const ElfW(Ehdr) *const ehdr = &_start;
@@ -225,7 +225,7 @@ init (int *data)
 
 #ifdef SHARED
       /* And readjust the dynamic linker's idea of where the argument
-         vector lives.  */
+	 vector lives.  */
       assert (_dl_argv == argv);
       _dl_argv = (void *) (newsp + 1);
 #endif
@@ -244,9 +244,16 @@ init (int *data)
       /* Push the user code address on the top of the new stack.  It will
 	 be the return address for `init1'; we will jump there with NEWSP
 	 as the stack pointer.  */
-      *--newsp = data[-1];
-      ((void **) data)[-1] = switch_stacks;
-      /* Force NEWSP into %ecx and &init1 into %eax, which are not restored
+      /* The following expression would typically be written as
+	 ``__builtin_return_address (0)''.  But, for example, GCC 4.4.6 doesn't
+	 recognize that this read operation may alias the following write
+	 operation, and thus is free to reorder the two, clobbering the
+	 original return address.  */
+      *--newsp = *((int *) __builtin_frame_address (0) + 1);
+      /* GCC 4.4.6 also wants us to force loading *NEWSP already here.  */
+      asm volatile ("# %0" : : "X" (*newsp));
+      *((void **) __builtin_frame_address (0) + 1) = &switch_stacks;
+      /* Force NEWSP into %eax and &init1 into %ecx, which are not restored
 	 by function return.  */
       asm volatile ("# a %0 c %1" : : "a" (newsp), "c" (&init1));
     }
@@ -273,8 +280,15 @@ init (int *data)
 
       /* The argument data is just above the stack frame we will unwind by
 	 returning.  Mutate our own return address to run the code below.  */
-      usercode = data[-1];
-      data[-1] = (int) &call_init1;
+      /* The following expression would typically be written as
+	 ``__builtin_return_address (0)''.  But, for example, GCC 4.4.6 doesn't
+	 recognize that this read operation may alias the following write
+	 operation, and thus is free to reorder the two, clobbering the
+	 original return address.  */
+      usercode = *((int *) __builtin_frame_address (0) + 1);
+      /* GCC 4.4.6 also wants us to force loading USERCODE already here.  */
+      asm volatile ("# %0" : : "X" (usercode));
+      *((void **) __builtin_frame_address (0) + 1) = &call_init1;
       /* Force USERCODE into %eax and &init1 into %ecx, which are not
 	 restored by function return.  */
       asm volatile ("# a %0 c %1" : : "a" (usercode), "c" (&init1));
@@ -322,11 +336,12 @@ first_init (void)
    stack set up just as the user will see it, so it can switch stacks.  */
 
 void
-_dl_init_first (void)
+_dl_init_first (int argc, ...)
 {
   first_init ();
 
-  init ((int *) __builtin_frame_address (0) + 2);
+  /* If we use ``__builtin_frame_address (0) + 2'' here, GCC gets confused.  */
+  init (&argc);
 }
 #endif
 
@@ -360,15 +375,17 @@ _hurd_stack_setup (void)
   void doinit (intptr_t *data)
     {
       /* This function gets called with the argument data at TOS.  */
-      void doinit1 (void)
+      void doinit1 (int argc, ...)
 	{
-	  init ((int *) __builtin_frame_address (0) + 2);
+	  /* If we use ``__builtin_frame_address (0) + 2'' here, GCC gets
+	     confused.  */
+	  init ((int *) &argc);
 	}
 
       /* Push the user return address after the argument data, and then
-         jump to `doinit1' (above), so it is as if __libc_init_first's
-         caller had called `doinit1' with the argument data already on the
-         stack.  */
+	 jump to `doinit1' (above), so it is as if __libc_init_first's
+	 caller had called `doinit1' with the argument data already on the
+	 stack.  */
       *--data = caller;
       asm volatile ("movl %0, %%esp\n" /* Switch to new outermost stack.  */
 		    "movl $0, %%ebp\n" /* Clear outermost frame pointer.  */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5aa3a74a59916b489e9cf7c4dce9eb149e106c6c

commit 5aa3a74a59916b489e9cf7c4dce9eb149e106c6c
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 13:15:40 2012 -0700

    Hurd: dup3

diff --git a/ChangeLog b/ChangeLog
index cab0489..9e747cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	dup3 for GNU Hurd.
+	* include/unistd.h: Declare __dup3 and use libc_hidden_proto on it.
+	* sysdeps/mach/hurd/dup3.c: New file, copy from dup2.c.  Evolve it to
+	implement dup3 and do some further code clean-ups.
+	* sysdeps/mach/hurd/dup2.c (__dup2): Reimplement using __dup3.
+	* sysdeps/mach/hurd/kernel-features.h (__ASSUME_DUP3): Define.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	* sysdeps/mach/hurd/dl-sysdep.c: Conditionalize contents on [SHARED].
diff --git a/include/unistd.h b/include/unistd.h
index 2e6101b..7971a8a 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -80,7 +80,8 @@ char *__canonicalize_directory_name_internal (const char *__thisdir,
 extern int __dup (int __fd);
 extern int __dup2 (int __fd, int __fd2);
 libc_hidden_proto (__dup2)
-libc_hidden_proto (dup3)
+extern int __dup3 (int __fd, int __fd2, int flags);
+libc_hidden_proto (__dup3)
 extern int __execve (const char *__path, char *const __argv[],
 		     char *const __envp[]);
 extern long int __pathconf (const char *__path, int __name);
diff --git a/sysdeps/mach/hurd/dup2.c b/sysdeps/mach/hurd/dup2.c
index d2329c9..b697a90 100644
--- a/sysdeps/mach/hurd/dup2.c
+++ b/sysdeps/mach/hurd/dup2.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2012 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
@@ -15,119 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <fcntl.h>
 #include <unistd.h>
-#include <hurd.h>
-#include <hurd/fd.h>
 
 /* Duplicate FD to FD2, closing the old FD2 and making FD2 be
    open on the same file as FD is.  Return FD2 or -1.  */
 int
-__dup2 (fd, fd2)
-     int fd;
-     int fd2;
+__dup2 (int fd, int fd2)
 {
-  struct hurd_fd *d;
-
-  /* Extract the ports and flags from FD.  */
-  d = _hurd_fd_get (fd);
-  if (d == NULL)
-    {
-      errno = EBADF;
-      return -1;
-    }
-
-  HURD_CRITICAL_BEGIN;
-
-  __spin_lock (&d->port.lock);
-  if (d->port.port == MACH_PORT_NULL)
-    {
-      __spin_unlock (&d->port.lock);
-      errno = EBADF;
-      fd2 = -1;
-    }
-  else if (fd2 == fd)
-    /* FD is valid and FD2 is already the same; just return it.  */
-    __spin_unlock (&d->port.lock);
-  else
-    {
-      struct hurd_userlink ulink, ctty_ulink;
-      int flags = d->flags;
-      io_t ctty = _hurd_port_get (&d->ctty, &ctty_ulink);
-      io_t port = _hurd_port_locked_get (&d->port, &ulink); /* Unlocks D.  */
-
-      if (fd2 < 0)
-	{
-	  errno = EBADF;
-	  fd2 = -1;
-	}
-      else
-	{
-	  /* Get a hold of the destination descriptor.  */
-	  struct hurd_fd *d2;
-
-	  if (fd2 >= _hurd_dtablesize)
-	    {
-	      /* The table is not large enough to hold the destination
-		 descriptor.  Enlarge it as necessary to allocate this
-		 descriptor.  */
-	      __mutex_unlock (&_hurd_dtable_lock);
-	      /* We still hold FD1's lock, but this is safe because
-		 _hurd_alloc_fd will only examine the cells starting
-		 at FD2.  */
-	      d2 = _hurd_alloc_fd (NULL, fd2);
-	      if (d2)
-		__spin_unlock (&d2->port.lock);
-	      __mutex_lock (&_hurd_dtable_lock);
-	    }
-	  else
-	    {
-	      d2 = _hurd_dtable[fd2];
-	      if (d2 == NULL)
-		{
-		  /* Must allocate a new one.  We don't initialize the port
-		     cells with this call so that if it fails (out of
-		     memory), we will not have already added user
-		     references for the ports, which we would then have to
-		     deallocate.  */
-		  d2 = _hurd_dtable[fd2] = _hurd_new_fd (MACH_PORT_NULL,
-							 MACH_PORT_NULL);
-		}
-	    }
-
-	  if (d2 == NULL)
-	    {
-	      fd2 = -1;
-	      if (errno == EINVAL)
-		errno = EBADF;	/* POSIX.1-1990 6.2.1.2 ll 54-55.  */
-	    }
-	  else
-	    {
-	      /* Give the ports each a user ref for the new descriptor.  */
-	      __mach_port_mod_refs (__mach_task_self (), port,
-				    MACH_PORT_RIGHT_SEND, 1);
-	      if (ctty != MACH_PORT_NULL)
-		__mach_port_mod_refs (__mach_task_self (), ctty,
-				      MACH_PORT_RIGHT_SEND, 1);
-
-	      /* Install the ports and flags in the new descriptor slot.  */
-	      __spin_lock (&d2->port.lock);
-	      d2->flags = flags & ~FD_CLOEXEC; /* Dup clears FD_CLOEXEC. */
-	      _hurd_port_set (&d2->ctty, ctty);
-	      _hurd_port_locked_set (&d2->port, port); /* Unlocks D2.  */
-	    }
-	}
-      __mutex_unlock (&_hurd_dtable_lock);
-
-      _hurd_port_free (&d->port, &ulink, port);
-      if (ctty != MACH_PORT_NULL)
-	_hurd_port_free (&d->ctty, &ctty_ulink, port);
-    }
+  int flags = 0;
 
-  HURD_CRITICAL_END;
+  if (fd2 == fd)
+    /* See the comment in dup3.  */
+    flags = -1;
 
-  return fd2;
+  return __dup3 (fd, fd2, flags);
 }
 libc_hidden_def (__dup2)
 weak_alias (__dup2, dup2)
diff --git a/sysdeps/mach/hurd/dup2.c b/sysdeps/mach/hurd/dup3.c
similarity index 74%
copy from sysdeps/mach/hurd/dup2.c
copy to sysdeps/mach/hurd/dup3.c
index d2329c9..8a38caf 100644
--- a/sysdeps/mach/hurd/dup2.c
+++ b/sysdeps/mach/hurd/dup3.c
@@ -1,4 +1,6 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97, 2002 Free Software Foundation, Inc.
+/* Duplicate a file descriptor to a given number, with flags.  Hurd version.
+   Copyright (C) 1991-2012 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
@@ -12,8 +14,9 @@
    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, see
-   <http://www.gnu.org/licenses/>.  */
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <fcntl.h>
@@ -22,21 +25,27 @@
 #include <hurd/fd.h>
 
 /* Duplicate FD to FD2, closing the old FD2 and making FD2 be
-   open on the same file as FD is.  Return FD2 or -1.  */
+   open on the same file as FD is, and setting FD2's flags according to FLAGS.
+   Return FD2 or -1.  */
 int
-__dup2 (fd, fd2)
-     int fd;
-     int fd2;
+__dup3 (int fd, int fd2, int flags)
 {
   struct hurd_fd *d;
 
+  /* Both passing flags different from O_CLOEXEC and FD2 being the same as FD
+     are invalid.  */
+  if ((flags & ~O_CLOEXEC
+       || fd2 == fd)
+      /* ... with the exception in case that dup2 behavior is requested: if FD
+	 is valid and FD2 is already the same then just return it.  */
+      && ! (flags == -1
+	    && fd2 == fd))
+    return __hurd_fail (EINVAL);
+
   /* Extract the ports and flags from FD.  */
   d = _hurd_fd_get (fd);
   if (d == NULL)
-    {
-      errno = EBADF;
-      return -1;
-    }
+    return __hurd_fail (EBADF);
 
   HURD_CRITICAL_BEGIN;
 
@@ -44,24 +53,19 @@ __dup2 (fd, fd2)
   if (d->port.port == MACH_PORT_NULL)
     {
       __spin_unlock (&d->port.lock);
-      errno = EBADF;
-      fd2 = -1;
+      fd2 = __hurd_fail (EBADF);
     }
   else if (fd2 == fd)
-    /* FD is valid and FD2 is already the same; just return it.  */
     __spin_unlock (&d->port.lock);
   else
     {
       struct hurd_userlink ulink, ctty_ulink;
-      int flags = d->flags;
+      int d_flags = d->flags;
       io_t ctty = _hurd_port_get (&d->ctty, &ctty_ulink);
       io_t port = _hurd_port_locked_get (&d->port, &ulink); /* Unlocks D.  */
 
       if (fd2 < 0)
-	{
-	  errno = EBADF;
-	  fd2 = -1;
-	}
+	fd2 = __hurd_fail (EBADF);
       else
 	{
 	  /* Get a hold of the destination descriptor.  */
@@ -113,7 +117,11 @@ __dup2 (fd, fd2)
 
 	      /* Install the ports and flags in the new descriptor slot.  */
 	      __spin_lock (&d2->port.lock);
-	      d2->flags = flags & ~FD_CLOEXEC; /* Dup clears FD_CLOEXEC. */
+	      if (flags & O_CLOEXEC)
+		d2->flags = d_flags | FD_CLOEXEC;
+	      else
+		/* dup clears FD_CLOEXEC.  */
+		d2->flags = d_flags & ~FD_CLOEXEC;
 	      _hurd_port_set (&d2->ctty, ctty);
 	      _hurd_port_locked_set (&d2->port, port); /* Unlocks D2.  */
 	    }
@@ -129,5 +137,5 @@ __dup2 (fd, fd2)
 
   return fd2;
 }
-libc_hidden_def (__dup2)
-weak_alias (__dup2, dup2)
+libc_hidden_def (__dup3)
+weak_alias (__dup3, dup3)
diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
index a0ffcbe..96a0d56 100644
--- a/sysdeps/mach/hurd/kernel-features.h
+++ b/sysdeps/mach/hurd/kernel-features.h
@@ -1,5 +1,5 @@
 /* Set flags signalling availability of certain operating system features.
-   Copyright (C) 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -20,13 +20,6 @@
    Almost none of these are used outside of sysdeps/unix/sysv/linux code.
    But those referring to POSIX-level features like O_* flags can be.  */
 
-#include <fcntl.h>
-
-/* If a system defines the O_CLOEXEC constant but it is sometimes ignored,
-   it must override this file to define __ASSUME_O_CLOEXEC conditionally
-   (or not at all) to indicate when O_CLOEXEC actually works.  */
-#ifdef O_CLOEXEC
-# define __ASSUME_O_CLOEXEC	1
-#endif
-
+#define __ASSUME_O_CLOEXEC	1
+#define __ASSUME_DUP3		1
 #define __ASSUME_ACCEPT4	1

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cd9fa98583b51812e906f1e85cc6e370bb4aff87

commit cd9fa98583b51812e906f1e85cc6e370bb4aff87
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 13:10:21 2012 -0700

    Hurd: Hurd: dl-sysdep.c: Include code only #ifdef SHARED.

diff --git a/ChangeLog b/ChangeLog
index 83afde7..cab0489 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+	* sysdeps/mach/hurd/dl-sysdep.c: Conditionalize contents on [SHARED].
+
         * hurd/hurd/fd.h (_hurd_fd_get): Call HURD_CRITICAL_BEGIN/
         HURD_CRITICAL_END around holding _hurd_dtable_lock.
         * sysdeps/mach/hurd/dirfd (dirfd): Likewise.
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 26a212e..13b0010 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -16,6 +16,10 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+/* In the static library, this is all handled by dl-support.c
+   or by the vanilla definitions in the rest of the C library.  */
+#ifdef SHARED
+
 #include <hurd.h>
 #include <link.h>
 #include <unistd.h>
@@ -667,3 +671,5 @@ _dl_init_first (int argc, ...)
 {
   /* This no-op definition only gets used if libc is not linked in.  */
 }
+
+#endif /* SHARED */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=802ca5a5efa5d11836b2ffd81c9f6fd42f938ac6

commit 802ca5a5efa5d11836b2ffd81c9f6fd42f938ac6
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 13:00:01 2012 -0700

    Hurd: Missing critical region locks.

diff --git a/ChangeLog b/ChangeLog
index 0d93e03..83afde7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
+        * hurd/hurd/fd.h (_hurd_fd_get): Call HURD_CRITICAL_BEGIN/
+        HURD_CRITICAL_END around holding _hurd_dtable_lock.
+        * sysdeps/mach/hurd/dirfd (dirfd): Likewise.
+        * sysdeps/mach/hurd/opendir.c (_hurd_fd_opendir): Call
+        HURD_CRITICAL_BEGIN/HURD_CRITICAL_END around holding
+        d->port.lock.
+
         * hurd/catch-signal.c (hurd_catch_signal): Use sigsetjmp/siglongjmp
         instead of setjmp/longjmp to restore the signal mask.  Call sigsetjmp
         when handler == SIG_ERR, not when handler != SIG_ERR.
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index 5044f97..6a79738 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -63,6 +63,7 @@ _hurd_fd_get (int fd)
 {
   struct hurd_fd *descriptor;
 
+  HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_dtable_lock);
   if (fd < 0 || fd >= _hurd_dtablesize)
     descriptor = NULL;
@@ -85,6 +86,7 @@ _hurd_fd_get (int fd)
 	}
     }
   __mutex_unlock (&_hurd_dtable_lock);
+  HURD_CRITICAL_END;
 
   return descriptor;
 }
diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c
index 587ae7b..42dbc78 100644
--- a/sysdeps/mach/hurd/dirfd.c
+++ b/sysdeps/mach/hurd/dirfd.c
@@ -1,5 +1,5 @@
 /* dirfd -- Return the file descriptor used by a DIR stream.  Hurd version.
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 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
@@ -25,6 +25,8 @@ int
 dirfd (DIR *dirp)
 {
   int fd;
+
+  HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_dtable_lock);
   for (fd = 0; fd < _hurd_dtablesize; ++fd)
     if (_hurd_dtable[fd] == dirp->__fd)
@@ -35,6 +37,7 @@ dirfd (DIR *dirp)
       fd = -1;
     }
   __mutex_unlock (&_hurd_dtable_lock);
+  HURD_CRITICAL_END;
 
   return fd;
 }
diff --git a/sysdeps/mach/hurd/opendir.c b/sysdeps/mach/hurd/opendir.c
index 217d4c8..c71cb18 100644
--- a/sysdeps/mach/hurd/opendir.c
+++ b/sysdeps/mach/hurd/opendir.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1994,1995,1996,1997,1998,2001,2003,2005,2006
-	Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 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
@@ -50,9 +49,11 @@ _hurd_fd_opendir (struct hurd_fd *d)
     return NULL;
 
   /* Set the descriptor to close on exec. */
+  HURD_CRITICAL_BEGIN;
   __spin_lock (&d->port.lock);
   d->flags |= FD_CLOEXEC;
   __spin_unlock (&d->port.lock);
+  HURD_CRITICAL_END;
 
   dirp->__fd = d;
   dirp->__data = dirp->__ptr = NULL;

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ecd0de9a955fd14e825a666ea6785842e1579326

commit ecd0de9a955fd14e825a666ea6785842e1579326
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 12:59:00 2012 -0700

    Hurd: Fix signal-catching functions.

diff --git a/ChangeLog b/ChangeLog
index ff43445..0d93e03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+        * hurd/catch-signal.c (hurd_catch_signal): Use sigsetjmp/siglongjmp
+        instead of setjmp/longjmp to restore the signal mask.  Call sigsetjmp
+        when handler == SIG_ERR, not when handler != SIG_ERR.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* sysdeps/mach/hurd/bits/socket.h: New file, copy from the bsd4.4 one.
diff --git a/hurd/catch-signal.c b/hurd/catch-signal.c
index 50cd366..3f946e1 100644
--- a/hurd/catch-signal.c
+++ b/hurd/catch-signal.c
@@ -1,5 +1,5 @@
 /* Convenience function to catch expected signals during an operation.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996-2012 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
@@ -27,9 +27,12 @@ hurd_catch_signal (sigset_t sigset,
 		   error_t (*operate) (struct hurd_signal_preemptor *),
 		   sighandler_t handler)
 {
-  jmp_buf buf;
+  /* We need to restore the signal mask, because otherwise the
+     signal-handling code will have blocked the caught signal and for
+     instance calling hurd_catch_signal again would then dump core.  */
+  sigjmp_buf buf;
   void throw (int signo, long int sigcode, struct sigcontext *scp)
-    { longjmp (buf, scp->sc_error ?: EGRATUITOUS); }
+    { siglongjmp (buf, scp->sc_error ?: EGRATUITOUS); }
 
   struct hurd_signal_preemptor preemptor =
     {
@@ -40,12 +43,12 @@ hurd_catch_signal (sigset_t sigset,
   struct hurd_sigstate *const ss = _hurd_self_sigstate ();
   error_t error;
 
-  if (handler == SIG_ERR)
+  if (handler != SIG_ERR)
     /* Not our handler; don't bother saving state.  */
     error = 0;
   else
     /* This returns again with nonzero value when we preempt a signal.  */
-    error = setjmp (buf);
+    error = sigsetjmp (buf, 1);
 
   if (error == 0)
     {

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6960eb420d7b7cc18420dd68466b664867fa069d

commit 6960eb420d7b7cc18420dd68466b664867fa069d
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 12:56:56 2012 -0700

    Hurd: bits/socket.h

diff --git a/ChangeLog b/ChangeLog
index 0d38d29..ff43445 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	* sysdeps/mach/hurd/bits/socket.h: New file, copy from the bsd4.4 one.
+	(SOCK_MAX, SOCK_TYPE_MASK, SOCK_CLOEXEC, SOCK_NONBLOCK): New
+	definitions.
+
 	accept4 for GNU Hurd.
 	* include/sys/socket.h (__libc_accept4): New prototype.
 	* sysdeps/mach/hurd/accept4.c: New file, copy from accept.c.  Evolve it
diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h
new file mode 100644
index 0000000..6d53599
--- /dev/null
+++ b/sysdeps/mach/hurd/bits/socket.h
@@ -0,0 +1,362 @@
+/* System-specific socket constants and types.  Hurd version.
+   Copyright (C) 1991-2012 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; see the file COPYING.LIB.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef __BITS_SOCKET_H
+#define __BITS_SOCKET_H	1
+
+#ifndef _SYS_SOCKET_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>		/* XXX Is this allowed?  */
+#include <bits/types.h>
+
+/* Type for length arguments in socket calls.  */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+
+/* Types of sockets.  */
+enum __socket_type
+{
+  SOCK_STREAM = 1,		/* Sequenced, reliable, connection-based
+				   byte streams.  */
+#define SOCK_STREAM SOCK_STREAM
+  SOCK_DGRAM = 2,		/* Connectionless, unreliable datagrams
+				   of fixed maximum length.  */
+#define SOCK_DGRAM SOCK_DGRAM
+  SOCK_RAW = 3,			/* Raw protocol interface.  */
+#define SOCK_RAW SOCK_RAW
+  SOCK_RDM = 4,			/* Reliably-delivered messages.  */
+#define SOCK_RDM SOCK_RDM
+  SOCK_SEQPACKET = 5,		/* Sequenced, reliable, connection-based,
+				   datagrams of fixed maximum length.  */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+
+#define SOCK_MAX (SOCK_SEQPACKET + 1)
+  /* Mask which covers at least up to SOCK_MASK-1.  The
+     remaining bits are used as flags. */
+#define SOCK_TYPE_MASK 0xf
+
+  /* Flags to be ORed into the type parameter of socket and socketpair and
+     used for the flags parameter of accept4.  */
+
+  SOCK_CLOEXEC = 0x00400000,	/* Atomically set close-on-exec flag for the
+				   new descriptor(s).  */
+#define SOCK_CLOEXEC SOCK_CLOEXEC
+
+  /* Changed from the O_NONBLOCK value (0x8, which is unusable for us as it is
+     conflicting with the original SOCK_* flags' values) to the Linux value
+     (04000).  TODO: is there a ``better'' value?  */
+  SOCK_NONBLOCK = 0x0800	/* Atomically mark descriptor(s) as
+				   non-blocking.  */
+#define SOCK_NONBLOCK SOCK_NONBLOCK
+};
+
+/* Protocol families.  */
+#define	PF_UNSPEC	0	/* Unspecified.  */
+#define	PF_LOCAL	1	/* Local to host (pipes and file-domain).  */
+#define	PF_UNIX		PF_LOCAL /* Old BSD name for PF_LOCAL.  */
+#define	PF_FILE		PF_LOCAL /* POSIX name for PF_LOCAL.  */
+#define	PF_INET		2	/* IP protocol family.  */
+#define	PF_IMPLINK	3	/* ARPAnet IMP protocol.  */
+#define	PF_PUP		4	/* PUP protocols.  */
+#define	PF_CHAOS	5	/* MIT Chaos protocols.  */
+#define	PF_NS		6	/* Xerox NS protocols.  */
+#define	PF_ISO		7	/* ISO protocols.  */
+#define	PF_OSI		PF_ISO
+#define	PF_ECMA		8	/* ECMA protocols.  */
+#define	PF_DATAKIT	9	/* AT&T Datakit protocols.  */
+#define	PF_CCITT	10	/* CCITT protocols (X.25 et al).  */
+#define	PF_SNA		11	/* IBM SNA protocol.  */
+#define	PF_DECnet	12	/* DECnet protocols.  */
+#define	PF_DLI		13	/* Direct data link interface.  */
+#define	PF_LAT		14	/* DEC Local Area Transport protocol.  */
+#define	PF_HYLINK	15	/* NSC Hyperchannel protocol.  */
+#define	PF_APPLETALK	16	/* Don't use this.  */
+#define	PF_ROUTE	17	/* Internal Routing Protocol.  */
+#define	PF_LINK		18	/* Link layer interface.  */
+#define	PF_XTP		19	/* eXpress Transfer Protocol (no AF).  */
+#define	PF_COIP		20	/* Connection-oriented IP, aka ST II.  */
+#define	PF_CNT		21	/* Computer Network Technology.  */
+#define PF_RTIP		22	/* Help Identify RTIP packets.  **/
+#define	PF_IPX		23	/* Novell Internet Protocol.  */
+#define	PF_SIP		24	/* Simple Internet Protocol.  */
+#define PF_PIP		25	/* Help Identify PIP packets.  */
+#define PF_INET6	26	/* IP version 6.  */
+#define	PF_MAX		27
+
+/* Address families.  */
+#define	AF_UNSPEC	PF_UNSPEC
+#define	AF_LOCAL	PF_LOCAL
+#define	AF_UNIX		PF_UNIX
+#define	AF_FILE		PF_FILE
+#define	AF_INET		PF_INET
+#define	AF_IMPLINK	PF_IMPLINK
+#define	AF_PUP		PF_PUP
+#define	AF_CHAOS	PF_CHAOS
+#define	AF_NS		PF_NS
+#define	AF_ISO		PF_ISO
+#define	AF_OSI		PF_OSI
+#define	AF_ECMA		PF_ECMA
+#define	AF_DATAKIT	PF_DATAKIT
+#define	AF_CCITT	PF_CCITT
+#define	AF_SNA		PF_SNA
+#define	AF_DECnet	PF_DECnet
+#define	AF_DLI		PF_DLI
+#define	AF_LAT		PF_LAT
+#define	AF_HYLINK	PF_HYLINK
+#define	AF_APPLETALK	PF_APPLETALK
+#define	AF_ROUTE	PF_ROUTE
+#define	AF_LINK		PF_LINK
+#define	pseudo_AF_XTP	PF_XTP
+#define	AF_COIP		PF_COIP
+#define	AF_CNT		PF_CNT
+#define pseudo_AF_RTIP	PF_RTIP
+#define	AF_IPX		PF_IPX
+#define	AF_SIP		PF_SIP
+#define pseudo_AF_PIP	PF_PIP
+#define AF_INET6	PF_INET6
+#define	AF_MAX		PF_MAX
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128	/* 5 on the origional 4.4 BSD.  */
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address.  */
+struct sockaddr
+  {
+    __SOCKADDR_COMMON (sa_);	/* Common data: address family and length.  */
+    char sa_data[14];		/* Address data.  */
+  };
+
+
+/* Structure large enough to hold any socket address (with the historical
+   exception of AF_UNIX).  We reserve 128 bytes.  */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype	__uint64_t
+#else
+# define __ss_aligntype	__uint32_t
+#endif
+#define _SS_SIZE	128
+#define _SS_PADSIZE	(_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+  {
+    __SOCKADDR_COMMON (ss_);	/* Address family, etc.  */
+    __ss_aligntype __ss_align;	/* Force desired alignment.  */
+    char __ss_padding[_SS_PADSIZE];
+  };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al.  */
+enum
+  {
+    MSG_OOB		= 0x01,	/* Process out-of-band data.  */
+#define MSG_OOB MSG_OOB
+    MSG_PEEK		= 0x02,	/* Peek at incoming messages.  */
+#define MSG_PEEK MSG_PEEK
+    MSG_DONTROUTE	= 0x04,	/* Don't use local routing.  */
+#define MSG_DONTROUTE MSG_DONTROUTE
+    MSG_EOR		= 0x08,	/* Data completes record.  */
+#define MSG_EOR MSG_EOR
+    MSG_TRUNC		= 0x10,	/* Data discarded before delivery.  */
+#define MSG_TRUNC MSG_TRUNC
+    MSG_CTRUNC		= 0x20,	/* Control data lost before delivery.  */
+#define MSG_CTRUNC MSG_CTRUNC
+    MSG_WAITALL		= 0x40,	/* Wait for full request or error.  */
+#define MSG_WAITALL MSG_WAITALL
+    MSG_DONTWAIT	= 0x80,	/* This message should be nonblocking.  */
+#define MSG_DONTWAIT MSG_DONTWAIT
+    MSG_NOSIGNAL	= 0x0400	/* Do not generate SIGPIPE on EPIPE.  */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+  };
+
+
+/* Structure describing messages sent by
+   `sendmsg' and received by `recvmsg'.  */
+struct msghdr
+  {
+    void *msg_name;		/* Address to send to/receive from.  */
+    socklen_t msg_namelen;	/* Length of address data.  */
+
+    struct iovec *msg_iov;	/* Vector of data to send/receive into.  */
+    int msg_iovlen;		/* Number of elements in the vector.  */
+
+    void *msg_control;		/* Ancillary data (eg BSD filedesc passing). */
+    socklen_t msg_controllen;	/* Ancillary data buffer length.  */
+
+    int msg_flags;		/* Flags in received message.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    socklen_t cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+    __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)		      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+			   & (size_t) ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+			 + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len)   (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
+				      struct cmsghdr *__cmsg) __THROW;
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE __extern_inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
+{
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return NULL;
+
+  __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+			       + CMSG_ALIGN (__cmsg->cmsg_len));
+  if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+					+ __mhdr->msg_controllen)
+      || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+	  > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+    /* No more entries.  */
+    return NULL;
+  return __cmsg;
+}
+#endif	/* Use `extern inline'.  */
+
+/* Socket level message types.  */
+enum
+  {
+    SCM_RIGHTS = 0x01,		/* Access rights (array of int).  */
+#define SCM_RIGHTS SCM_RIGHTS
+    SCM_TIMESTAMP = 0x02,	/* Timestamp (struct timeval).  */
+#define SCM_TIMESTAMP SCM_TIMESTAMP
+    SCM_CREDS = 0x03		/* Process creds (struct cmsgcred).  */
+#define SCM_CREDS SCM_CREDS
+  };
+
+/* Unfortunately, BSD practice dictates this structure be of fixed size.
+   If there are more than CMGROUP_MAX groups, the list is truncated.
+   (On GNU systems, the `cmcred_euid' field is just the first in the
+   list of effective UIDs.)  */
+#define CMGROUP_MAX	16
+
+/* Structure delivered by SCM_CREDS.  This describes the identity of the
+   sender of the data simultaneously received on the socket.  By BSD
+   convention, this is included only when a sender on a AF_LOCAL socket
+   sends cmsg data of this type and size; the sender's structure is
+   ignored, and the system fills in the various IDs of the sender process.  */
+struct cmsgcred
+  {
+    __pid_t cmcred_pid;
+    __uid_t cmcred_uid;
+    __uid_t cmcred_euid;
+    __gid_t cmcred_gid;
+    int cmcred_ngroups;
+    __gid_t cmcred_groups[CMGROUP_MAX];
+  };
+
+/* Protocol number used to manipulate socket-level options
+   with `getsockopt' and `setsockopt'.  */
+#define	SOL_SOCKET	0xffff
+
+/* Socket-level options for `getsockopt' and `setsockopt'.  */
+enum
+  {
+    SO_DEBUG = 0x0001,		/* Record debugging information.  */
+#define SO_DEBUG SO_DEBUG
+    SO_ACCEPTCONN = 0x0002,	/* Accept connections on socket.  */
+#define SO_ACCEPTCONN SO_ACCEPTCONN
+    SO_REUSEADDR = 0x0004,	/* Allow reuse of local addresses.  */
+#define SO_REUSEADDR SO_REUSEADDR
+    SO_KEEPALIVE = 0x0008,	/* Keep connections alive and send
+				   SIGPIPE when they die.  */
+#define SO_KEEPALIVE SO_KEEPALIVE
+    SO_DONTROUTE = 0x0010,	/* Don't do local routing.  */
+#define SO_DONTROUTE SO_DONTROUTE
+    SO_BROADCAST = 0x0020,	/* Allow transmission of
+				   broadcast messages.  */
+#define SO_BROADCAST SO_BROADCAST
+    SO_USELOOPBACK = 0x0040,	/* Use the software loopback to avoid
+				   hardware use when possible.  */
+#define SO_USELOOPBACK SO_USELOOPBACK
+    SO_LINGER = 0x0080,		/* Block on close of a reliable
+				   socket to transmit pending data.  */
+#define SO_LINGER SO_LINGER
+    SO_OOBINLINE = 0x0100,	/* Receive out-of-band data in-band.  */
+#define SO_OOBINLINE SO_OOBINLINE
+    SO_REUSEPORT = 0x0200,	/* Allow local address and port reuse.  */
+#define SO_REUSEPORT SO_REUSEPORT
+    SO_SNDBUF = 0x1001,		/* Send buffer size.  */
+#define SO_SNDBUF SO_SNDBUF
+    SO_RCVBUF = 0x1002,		/* Receive buffer.  */
+#define SO_RCVBUF SO_RCVBUF
+    SO_SNDLOWAT = 0x1003,	/* Send low-water mark.  */
+#define SO_SNDLOWAT SO_SNDLOWAT
+    SO_RCVLOWAT = 0x1004,	/* Receive low-water mark.  */
+#define SO_RCVLOWAT SO_RCVLOWAT
+    SO_SNDTIMEO = 0x1005,	/* Send timeout.  */
+#define SO_SNDTIMEO SO_SNDTIMEO
+    SO_RCVTIMEO = 0x1006,	/* Receive timeout.  */
+#define SO_RCVTIMEO SO_RCVTIMEO
+    SO_ERROR = 0x1007,		/* Get and clear error status.  */
+#define SO_ERROR SO_ERROR
+    SO_STYLE = 0x1008,		/* Get socket connection style.  */
+#define SO_STYLE SO_STYLE
+    SO_TYPE = SO_STYLE		/* Compatible name for SO_STYLE.  */
+#define SO_TYPE SO_TYPE
+  };
+
+/* Structure used to manipulate the SO_LINGER option.  */
+struct linger
+  {
+    int l_onoff;		/* Nonzero to linger on close.  */
+    int l_linger;		/* Time to linger.  */
+  };
+
+#endif	/* bits/socket.h */

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=eb43375f0f7640a32fd6c67b94291419acb872d8

commit eb43375f0f7640a32fd6c67b94291419acb872d8
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 12:53:02 2012 -0700

    Hurd: accept4

diff --git a/ChangeLog b/ChangeLog
index 9aa8753..0d38d29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
+	accept4 for GNU Hurd.
+	* include/sys/socket.h (__libc_accept4): New prototype.
+	* sysdeps/mach/hurd/accept4.c: New file, copy from accept.c.  Evolve it
+	to implement __libc_accept4.
+	* sysdeps/mach/hurd/accept.c (accept): Reimplement using
+	__libc_accept4.
+	* sysdeps/mach/hurd/kernel-features.h (__ASSUME_ACCEPT4): Define.
+
 	* sysdeps/mach/hurd/i386/____longjmp_chk.S: New file.
 	* sysdeps/mach/hurd/i386/signal-defines.sym: New file.
 	* sysdeps/mach/hurd/i386/Makefile (gen-as-const-headers): Add
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 2ae3428..eac8213 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -135,6 +135,9 @@ extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
 			  socklen_t *__restrict __addr_len)
      __THROW;
 libc_hidden_proto (accept)
+extern int __libc_accept4 (int __fd, __SOCKADDR_ARG __addr,
+			   socklen_t *__restrict __addr_len, int __flags)
+     __THROW;
 
 /* Return the length of a `sockaddr' structure.  */
 #ifdef _HAVE_SA_LEN
diff --git a/sysdeps/mach/hurd/accept.c b/sysdeps/mach/hurd/accept.c
index 78b5c67..52dfdf8 100644
--- a/sysdeps/mach/hurd/accept.c
+++ b/sysdeps/mach/hurd/accept.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,1993,1994,1997,1999,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -15,72 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
 #include <sys/socket.h>
-#include <hurd.h>
-#include <hurd/fd.h>
-#include <hurd/socket.h>
 
 /* Await a connection on socket FD.
    When a connection arrives, open a new socket to communicate with it,
-   set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+   set *ADDRARG (which is *ADDR_LEN bytes long) to the address of the connecting
    peer and *ADDR_LEN to the address's actual length, and return the
    new socket's descriptor, or -1 for errors.  */
 int
-accept (fd, addrarg, addr_len)
-      int fd;
-      __SOCKADDR_ARG addrarg;
-      socklen_t *addr_len;
+accept (int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len)
 {
-  error_t err;
-  socket_t new;
-  addr_port_t aport;
-  struct sockaddr *addr = addrarg.__sockaddr__;
-  char *buf = (char *) addr;
-  mach_msg_type_number_t buflen;
-  int type;
-
-  if (err = HURD_DPORT_USE (fd, __socket_accept (port, &new, &aport)))
-    return __hurd_dfail (fd, err);
-
-  if (addr != NULL)
-    {
-      buflen = *addr_len;
-      err = __socket_whatis_address (aport, &type, &buf, &buflen);
-      if (err == EOPNOTSUPP)
-	/* If the protocol server can't tell us the address, just return a
-	   zero-length one.  */
-	{
-	  buf = (char *)addr;
-	  buflen = 0;
-	  err = 0;
-	}
-    }
-  __mach_port_deallocate (__mach_task_self (), aport);
-
-  if (err)
-    {
-      __mach_port_deallocate (__mach_task_self (), new);
-      return __hurd_dfail (fd, err);
-    }
-
-  if (addr != NULL)
-    {
-      if (*addr_len > buflen)
-	*addr_len = buflen;
-      
-      if (buf != (char *) addr)
-	{
-	  memcpy (addr, buf, *addr_len);
-	  __vm_deallocate (__mach_task_self (), (vm_address_t) buf, buflen);
-	}
-
-      if (buflen > 0)
-	addr->sa_family = type;
-    }
-
-  return _hurd_intern_fd (new, O_IGNORE_CTTY, 1);
+  return __libc_accept4 (fd, addrarg, addr_len, 0);
 }
 libc_hidden_def (accept)
diff --git a/sysdeps/mach/hurd/accept.c b/sysdeps/mach/hurd/accept4.c
similarity index 68%
copy from sysdeps/mach/hurd/accept.c
copy to sysdeps/mach/hurd/accept4.c
index 78b5c67..a86e177 100644
--- a/sysdeps/mach/hurd/accept.c
+++ b/sysdeps/mach/hurd/accept4.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,1993,1994,1997,1999,2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992-2012 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
@@ -12,11 +13,13 @@
    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, see
-   <http://www.gnu.org/licenses/>.  */
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <fcntl.h>
+#include <fcntl-internal.h>
 #include <string.h>
 #include <sys/socket.h>
 #include <hurd.h>
@@ -25,14 +28,12 @@
 
 /* Await a connection on socket FD.
    When a connection arrives, open a new socket to communicate with it,
-   set *ADDR (which is *ADDR_LEN bytes long) to the address of the connecting
+   set *ADDRARG (which is *ADDR_LEN bytes long) to the address of the connecting
    peer and *ADDR_LEN to the address's actual length, and return the
-   new socket's descriptor, or -1 for errors.  */
+   new socket's descriptor, or -1 for errors.  The operation can be influenced
+   by the FLAGS parameter.  */
 int
-accept (fd, addrarg, addr_len)
-      int fd;
-      __SOCKADDR_ARG addrarg;
-      socklen_t *addr_len;
+__libc_accept4 (int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len, int flags)
 {
   error_t err;
   socket_t new;
@@ -42,6 +43,11 @@ accept (fd, addrarg, addr_len)
   mach_msg_type_number_t buflen;
   int type;
 
+  flags = sock_to_o_flags (flags);
+
+  if (flags & ~(O_CLOEXEC | O_NONBLOCK))
+    return __hurd_fail (EINVAL);
+
   if (err = HURD_DPORT_USE (fd, __socket_accept (port, &new, &aport)))
     return __hurd_dfail (fd, err);
 
@@ -60,6 +66,13 @@ accept (fd, addrarg, addr_len)
     }
   __mach_port_deallocate (__mach_task_self (), aport);
 
+  if (! err)
+    {
+      if (flags & O_NONBLOCK)
+	err = __io_set_some_openmodes (new, O_NONBLOCK);
+      /* TODO: do we need special ERR massaging after the previous call?  */
+    }
+
   if (err)
     {
       __mach_port_deallocate (__mach_task_self (), new);
@@ -70,7 +83,7 @@ accept (fd, addrarg, addr_len)
     {
       if (*addr_len > buflen)
 	*addr_len = buflen;
-      
+
       if (buf != (char *) addr)
 	{
 	  memcpy (addr, buf, *addr_len);
@@ -81,6 +94,7 @@ accept (fd, addrarg, addr_len)
 	addr->sa_family = type;
     }
 
-  return _hurd_intern_fd (new, O_IGNORE_CTTY, 1);
+  return _hurd_intern_fd (new, O_IGNORE_CTTY | flags, 1);
 }
-libc_hidden_def (accept)
+libc_hidden_def (__libc_accept4)
+weak_alias (__libc_accept4, accept4)
diff --git a/sysdeps/mach/hurd/kernel-features.h b/sysdeps/mach/hurd/kernel-features.h
index 07caf31..a0ffcbe 100644
--- a/sysdeps/mach/hurd/kernel-features.h
+++ b/sysdeps/mach/hurd/kernel-features.h
@@ -1,5 +1,5 @@
 /* Set flags signalling availability of certain operating system features.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2012 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,3 +28,5 @@
 #ifdef O_CLOEXEC
 # define __ASSUME_O_CLOEXEC	1
 #endif
+
+#define __ASSUME_ACCEPT4	1

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bcf5524012216fee3a7668a3b43aad3243a083b0

commit bcf5524012216fee3a7668a3b43aad3243a083b0
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 12:47:31 2012 -0700

    Hurd: ____longjmp_chk

diff --git a/ChangeLog b/ChangeLog
index 976aa1e..9aa8753 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* sysdeps/mach/hurd/i386/____longjmp_chk.S: New file.
+	* sysdeps/mach/hurd/i386/signal-defines.sym: New file.
+	* sysdeps/mach/hurd/i386/Makefile (gen-as-const-headers): Add
+	signal-defines.sym.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
         * bits/in.h (SOL_IP, SOL_IPV6, SOL_ICMPV6): New macros.
diff --git a/sysdeps/mach/hurd/i386/Makefile b/sysdeps/mach/hurd/i386/Makefile
index 0eef17e..5f98809 100644
--- a/sysdeps/mach/hurd/i386/Makefile
+++ b/sysdeps/mach/hurd/i386/Makefile
@@ -2,3 +2,7 @@ ifeq ($(subdir),misc)
 sysdep_routines += ioperm
 sysdep_headers += sys/io.h
 endif
+
+ifeq ($(subdir),debug)
+gen-as-const-headers += signal-defines.sym
+endif
diff --git a/sysdeps/mach/hurd/i386/____longjmp_chk.S b/sysdeps/mach/hurd/i386/____longjmp_chk.S
new file mode 100644
index 0000000..f499fbd
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/____longjmp_chk.S
@@ -0,0 +1,107 @@
+/* Copyright (C) 2001-2012 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+#include <jmpbuf-offsets.h>
+#include <asm-syntax.h>
+
+#include <signal-defines.h>
+/* #include <signal.h> */
+#define SS_ONSTACK 1
+
+
+	.section .rodata.str1.1,"aMS",@progbits,1
+	.type	longjmp_msg,@object
+longjmp_msg:
+	.string "longjmp causes uninitialized stack frame"
+	.size	longjmp_msg, .-longjmp_msg
+
+
+#ifdef PIC
+# define CALL_FAIL	movl	%ebx, %ecx; /* TODO: what's this mov good for? */ \
+			cfi_register(%ebx,%ecx);			      \
+			LOAD_PIC_REG (bx);				      \
+			leal	longjmp_msg@GOTOFF(%ebx), %eax;		      \
+			call	HIDDEN_JUMPTARGET(__fortify_fail)
+#else
+# define CALL_FAIL	movl	$longjmp_msg, %eax;			      \
+			call	HIDDEN_JUMPTARGET(__fortify_fail)
+#endif
+
+
+	.text
+ENTRY (____longjmp_chk)
+	movl	4(%esp), %ecx	/* User's jmp_buf in %ecx.  */
+
+	/* Save the return address now.  */
+	movl	(JB_PC*4)(%ecx), %edx
+	/* Get the stack pointer.  */
+	movl	(JB_SP*4)(%ecx), %edi
+	cfi_undefined(%edi)
+	PTR_DEMANGLE (%edx)
+	PTR_DEMANGLE (%edi)
+
+	cmpl	%edi, %esp
+	/* Jumping to a higher-address frame is always allowed.  */
+	jbe	.Lok
+
+	/* Passing here, we're either about to do something invalid, or we're
+	executing on an alternative signal stack.  */
+
+	/* TODO: need locking?  */
+	/* struct hurd_sigstate * _hurd_self_sigstate (void) */
+	call	_hurd_self_sigstate
+	/* TODO: %eax and %eax->sigaltstack are always valid?  */
+
+	testl	$SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%eax)
+	/* Fail if SS_ONSTACK is not set.  */
+	jz	.Lfail
+
+	movl	(HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_SP__OFFSET)(%eax), %ebx
+	addl	(HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_SIZE__OFFSET)(%eax), %ebx
+	subl	%edi, %ebx
+	cmpl	(HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_SIZE__OFFSET)(%eax), %ebx
+	/* TODO: comment this calculation.  */
+	jae	.Lok
+
+.Lfail:	CALL_FAIL
+
+.Lok:	/* We add unwind information for the target here.  */
+	cfi_def_cfa(%ecx, 0)
+	cfi_register(%eip, %edx)
+	cfi_register(%esp, %edi)
+	cfi_offset(%ebx, JB_BX*4)
+	cfi_offset(%esi, JB_SI*4)
+	cfi_offset(%edi, JB_DI*4)
+	cfi_offset(%ebp, JB_BP*4)
+
+	movl	8(%esp), %eax	/* Second argument is return value.  */
+	movl	%edi, %esp
+
+	/* Restore registers.  */
+	movl	(JB_BX*4)(%ecx), %ebx
+	movl	(JB_SI*4)(%ecx), %esi
+	movl	(JB_DI*4)(%ecx), %edi
+	movl	(JB_BP*4)(%ecx), %ebp
+	cfi_restore(%ebx)
+	cfi_restore(%esi)
+	cfi_restore(%edi)
+	cfi_restore(%ebp)
+
+	/* Jump to saved PC.  */
+	jmp	*%edx
+END (____longjmp_chk)
diff --git a/sysdeps/mach/hurd/i386/signal-defines.sym b/sysdeps/mach/hurd/i386/signal-defines.sym
new file mode 100644
index 0000000..9521bd7
--- /dev/null
+++ b/sysdeps/mach/hurd/i386/signal-defines.sym
@@ -0,0 +1,10 @@
+#include <hurd/signal.h>
+#include <signal.h>
+
+--
+
+HURD_SIGSTATE__SIGALTSTACK__OFFSET	offsetof(struct hurd_sigstate, sigaltstack)
+
+SIGALTSTACK__SS_SP__OFFSET		offsetof(struct sigaltstack, ss_sp)
+SIGALTSTACK__SS_SIZE__OFFSET		offsetof(struct sigaltstack, ss_size)
+SIGALTSTACK__SS_FLAGS__OFFSET		offsetof(struct sigaltstack, ss_flags)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6178c55bdbb1e434b594e5f8563b6948f8f3edc0

commit 6178c55bdbb1e434b594e5f8563b6948f8f3edc0
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 12:47:00 2012 -0700

    Hurd: Add SOL_IP, SOL_IPV6, SOL_ICMPV6

diff --git a/ChangeLog b/ChangeLog
index bd66d5a..976aa1e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+        * bits/in.h (SOL_IP, SOL_IPV6, SOL_ICMPV6): New macros.
+
 2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
 
 	* sysdeps/mach/hurd/dl-sysdep.c (open_file): Do not raise
diff --git a/bits/in.h b/bits/in.h
index bb14b02..db93057 100644
--- a/bits/in.h
+++ b/bits/in.h
@@ -21,6 +21,9 @@
 # error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
 #endif
 
+/* To select the IP level.  */
+#define SOL_IP		0
+
 /* Options for use with `getsockopt' and `setsockopt' at the IP level.
    The first word in the comment at the right is the data type used;
    "bool" means a boolean value stored in an `int'.  */
@@ -47,6 +50,10 @@ struct ip_opts
     char ip_opts[40];		/* Actually variable in size.  */
   };
 
+/* Socket-level values for IPv6.  */
+#define SOL_IPV6		41
+#define SOL_ICMPV6		58
+
 /* IPV6 socket options.  */
 #define IPV6_ADDRFORM		1
 #define IPV6_PKTINFO		2

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6f080c2fcffac1bb8626b8d143dba57a37abb071

commit 6f080c2fcffac1bb8626b8d143dba57a37abb071
Author: Thomas Schwinge <thomas@schwinge.name>
Date:   Thu May 10 12:43:01 2012 -0700

    Hurd: O_CLOEXEC in rtld

diff --git a/ChangeLog b/ChangeLog
index 11ca6b7..bd66d5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-05-10  Thomas Schwinge  <thomas@schwinge.name>
+
+	* sysdeps/mach/hurd/dl-sysdep.c (open_file): Do not raise
+	assertion on O_CLOEXEC flag.
+	* hurd/hurd/fd.h: Update comment to mention O_CLOEXEC.
+	* hurd/intern-fd.c: Likewise.
+	* hurd/port2fd.c: Likewise.
+
 2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	[BZ #3906]
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index 5f3ee6a..5044f97 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -1,6 +1,5 @@
 /* File descriptors.
-   Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006,2007
-   	Free Software Foundation, Inc.
+   Copyright (C) 1993-2012 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
@@ -199,7 +198,8 @@ extern void _hurd_port2fd (struct hurd_fd *fd, io_t port, int flags);
 
 /* Allocate a new file descriptor and install PORT in it (doing any
    appropriate ctty magic); consumes a user reference on PORT.  FLAGS are
-   as for `open'; only O_IGNORE_CTTY is meaningful, but all are saved.
+   as for `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful, but all are
+   saved.
 
    If the descriptor table is full, set errno, and return -1.
    If DEALLOC is nonzero, deallocate PORT first.  */
diff --git a/hurd/intern-fd.c b/hurd/intern-fd.c
index 52e0606..ac89173 100644
--- a/hurd/intern-fd.c
+++ b/hurd/intern-fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 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
@@ -19,7 +19,7 @@
 #include <hurd/fd.h>
 
 /* Allocate a new file descriptor and install PORT in it.  FLAGS are as for
-   `open'; only O_IGNORE_CTTY is meaningful.
+   `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful.
 
    If the descriptor table is full, set errno, and return -1.
    If DEALLOC is nonzero, deallocate PORT first.  */
diff --git a/hurd/port2fd.c b/hurd/port2fd.c
index bef07ad..451d630 100644
--- a/hurd/port2fd.c
+++ b/hurd/port2fd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997, 1999, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2012 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,7 +22,7 @@
 #include <fcntl.h>
 
 /* Store PORT in file descriptor D, doing appropriate ctty magic.
-   FLAGS are as for `open'; only O_IGNORE_CTTY is meaningful.
+   FLAGS are as for `open'; only O_IGNORE_CTTY and O_CLOEXEC are meaningful.
    D should be locked, and will not be unlocked.  */
 
 void
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index d928cd2..26a212e 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -1,6 +1,5 @@
 /* Operating system support for run-time dynamic linker.  Hurd version.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2010
-	Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 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
@@ -315,7 +314,7 @@ open_file (const char *file_name, int flags,
       return MACH_PORT_NULL;
     }
 
-  assert (!(flags & ~O_READ));
+  assert (!(flags & ~(O_READ | O_CLOEXEC)));
 
   startdir = _dl_hurd_data->portarray[file_name[0] == '/' ?
 				      INIT_PORT_CRDIR : INIT_PORT_CWDIR];

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=bcfe3a546e831ff3e43a8782f65a95fab7bb864d

commit bcfe3a546e831ff3e43a8782f65a95fab7bb864d
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Thu May 10 12:37:15 2012 -0700

    Hurd: Add more ipv6 macros.

diff --git a/ChangeLog b/ChangeLog
index 6848fb4..11ca6b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-10  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	[BZ #3906]
+	* bits/in.h (IPV6_PKTINFO): Define new macro.
+	(IPV6_RXINFO,IPV6_TXINFO,SCM_SRCINFO): Redefine to IPV6_PKTINFO.
+
 2012-05-09  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	[BZ #13954]
@@ -150,16 +156,16 @@
 	(main): Remove informal message about syslog.
 	(options): Fix typo.
 
-        [BZ #14053]
-        * sysdeps/x86_64/fpu/bits/mathinline.h (lrintf): Add __volatile
+	[BZ #14053]
+	* sysdeps/x86_64/fpu/bits/mathinline.h (lrintf): Add __volatile
 	to asm.
-        (lrint): Likewise.
-        (llrintf): Likewise.
-        (llrint): Likewise.
-        (rint): Likewise.
-        (rintf): Likewise.
-        (nearbyint): Likewise.
-        (nearbyintf): Likewise.
+	(lrint): Likewise.
+	(llrintf): Likewise.
+	(llrint): Likewise.
+	(rint): Likewise.
+	(rintf): Likewise.
+	(nearbyint): Likewise.
+	(nearbyintf): Likewise.
 
 2012-05-09  Andreas Jaeger  <aj@suse.de>
 	    Pedro Alves  <palves@redhat.com>
@@ -170,12 +176,12 @@
 2012-05-09  Alexandre Oliva  <aoliva@redhat.com>
 	    Andreas Jaeger  <aj@suse.de>
 
-        * nscd/nscd.c (go_background): Replaced with...
-        (run_mode): ... this.
+	* nscd/nscd.c (go_background): Replaced with...
+	(run_mode): ... this.
 	(RUN_FOREGROUND, RUN_DAEMONIZE, RUN_DEBUG): Add.
-        (options): Add -F --foreground.
-        (main): Implement it.
-        (parse_opt): Parse it.
+	(options): Add -F --foreground.
+	(main): Implement it.
+	(parse_opt): Parse it.
 
 2012-05-09  Andreas Jaeger  <aj@suse.de>
 
@@ -351,9 +357,9 @@
 
 2012-05-08  Roland Mc Grath  <roland@hack.frob.com>
 
-        [BZ #13979]
-        * include/features.h: Warn if user requests __FORTIFY_SOURCE
-        checking but the checks are disabled for any reason.
+	[BZ #13979]
+	* include/features.h: Warn if user requests __FORTIFY_SOURCE
+	checking but the checks are disabled for any reason.
 
 2012-05-08  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/bits/in.h b/bits/in.h
index 85f747e..bb14b02 100644
--- a/bits/in.h
+++ b/bits/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2000, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 1997-2012 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
@@ -49,7 +49,7 @@ struct ip_opts
 
 /* IPV6 socket options.  */
 #define IPV6_ADDRFORM		1
-#define IPV6_RXINFO		2
+#define IPV6_PKTINFO		2
 #define IPV6_HOPOPTS		3
 #define IPV6_DSTOPTS		4
 #define IPV6_RTHDR		5
@@ -57,8 +57,9 @@ struct ip_opts
 #define IPV6_CHECKSUM		7
 #define IPV6_HOPLIMIT		8
 
-#define IPV6_TXINFO		IPV6_RXINFO
-#define SCM_SRCINFO		IPV6_TXINFO
+#define IPV6_RXINFO		IPV6_PKTINFO
+#define IPV6_TXINFO		IPV6_PKTINFO
+#define SCM_SRCINFO		IPV6_PKTINFO
 #define SCM_SRCRT		IPV6_RXSRCRT
 
 #define IPV6_UNICAST_HOPS	16

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                 |  289 ++++++++++++++++++++++--
 bits/in.h                                 |   16 +-
 bits/libc-lock.h                          |    5 +-
 bits/sigaction.h                          |    4 +-
 elf/Makefile                              |    5 +-
 hurd/catch-signal.c                       |   13 +-
 hurd/hurd/fd.h                            |    8 +-
 hurd/hurdchdir.c                          |    5 +-
 hurd/hurdselect.c                         |   28 ++-
 hurd/hurdsock.c                           |    8 +-
 hurd/intern-fd.c                          |    4 +-
 hurd/lookup-retry.c                       |    9 +-
 hurd/port2fd.c                            |    4 +-
 include/libc-symbols.h                    |    4 +-
 include/sys/socket.h                      |    3 +
 include/unistd.h                          |    3 +-
 io/fcntl.h                                |   26 ++-
 libio/fileops.c                           |    4 +-
 libio/freopen.c                           |    5 +-
 libio/freopen64.c                         |    5 +-
 math/w_ilogbf.c                           |    1 +
 misc/syslog.c                             |    2 +
 nptl/ChangeLog                            |    5 +
 nptl/sysdeps/pthread/bits/libc-lockP.h    |    2 +
 nscd/connections.c                        |    7 +-
 nscd/netgroupcache.c                      |    7 +-
 nss/makedb.c                              |    8 +-
 nss/nss_db/db-initgroups.c                |    2 +
 posix/tst-sysconf.c                       |    6 +
 streams/stropts.h                         |    3 +-
 sysdeps/generic/ldsodefs.h                |    6 +-
 sysdeps/generic/paths.h                   |    8 +-
 sysdeps/gnu/configure                     |   36 +++
 sysdeps/gnu/configure.in                  |   36 +++
 sysdeps/mach/bits/libc-lock.h             |    5 +-
 sysdeps/mach/hurd/Makefile                |    3 +-
 sysdeps/mach/hurd/accept.c                |   65 +-----
 sysdeps/mach/hurd/accept4.c               |  100 ++++++++
 sysdeps/mach/hurd/bits/fcntl.h            |   11 +-
 sysdeps/mach/hurd/bits/ioctls.h           |    3 +-
 sysdeps/mach/hurd/bits/libc-lock.h        |    5 +-
 sysdeps/mach/hurd/bits/posix_opt.h        |   30 ++-
 sysdeps/mach/hurd/bits/socket.h           |  362 +++++++++++++++++++++++++++++
 sysdeps/mach/hurd/bits/stat.h             |   59 ++++--
 sysdeps/mach/hurd/brk.c                   |   20 ++-
 sysdeps/mach/hurd/chroot.c                |    5 +-
 sysdeps/mach/hurd/configure               |  170 ++++++++++----
 sysdeps/mach/hurd/configure.in            |    4 -
 sysdeps/mach/hurd/dirfd.c                 |    5 +-
 sysdeps/mach/hurd/dl-sysdep.c             |   11 +-
 sysdeps/mach/hurd/dl-sysdep.h             |    5 +-
 sysdeps/mach/hurd/dup2.c                  |  114 +---------
 sysdeps/mach/hurd/dup3.c                  |  140 +++++++++++
 sysdeps/mach/hurd/i386/Makefile           |    4 +
 sysdeps/mach/hurd/i386/____longjmp_chk.S  |  107 +++++++++
 sysdeps/mach/hurd/i386/init-first.c       |   47 +++--
 sysdeps/mach/hurd/i386/signal-defines.sym |   10 +
 sysdeps/mach/hurd/ioctl.c                 |   21 +-
 sysdeps/mach/hurd/kernel-features.h       |   13 +-
 sysdeps/mach/hurd/mkdir.c                 |    8 +-
 sysdeps/mach/hurd/mkdirat.c               |    9 +-
 sysdeps/mach/hurd/mlock.c                 |    4 +-
 sysdeps/mach/hurd/openat.c                |    6 +-
 sysdeps/mach/hurd/opendir.c               |   42 ++++-
 sysdeps/mach/hurd/readlinkat.c            |   64 +++++
 sysdeps/mach/hurd/recvfrom.c              |    6 +-
 sysdeps/mach/hurd/setitimer.c             |    5 +-
 sysdeps/mach/hurd/setresgid.c             |   76 +++++--
 sysdeps/mach/hurd/setresuid.c             |   75 +++++--
 sysdeps/mach/hurd/xmknodat.c              |   10 +-
 sysdeps/mach/hurd/xstatconv.c             |   11 +-
 sysdeps/mach/nanosleep.c                  |   33 ++-
 sysdeps/posix/getaddrinfo.c               |    2 +-
 sysdeps/posix/getcwd.c                    |    3 +-
 sysdeps/unix/sysv/linux/configure         |   32 ---
 sysdeps/unix/sysv/linux/configure.in      |   32 ---
 76 files changed, 1819 insertions(+), 495 deletions(-)
 create mode 100644 sysdeps/gnu/configure
 create mode 100644 sysdeps/gnu/configure.in
 create mode 100644 sysdeps/mach/hurd/accept4.c
 create mode 100644 sysdeps/mach/hurd/bits/socket.h
 create mode 100644 sysdeps/mach/hurd/dup3.c
 create mode 100644 sysdeps/mach/hurd/i386/____longjmp_chk.S
 create mode 100644 sysdeps/mach/hurd/i386/signal-defines.sym
 create mode 100644 sysdeps/mach/hurd/readlinkat.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]