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

[Commits] r21759 - in /fsf/trunk/libc: ./ elf/ ports/ ports/sysdeps/mips/bits/ posix/ sysdeps/posix/ sysdeps/unix/sysv/linux/



Author: eglibc
Date: Sat Nov 17 17:27:58 2012
New Revision: 21759

Log:
Import glibc-mainline for 2012-11-17

Added:
    fsf/trunk/libc/posix/getconf-speclist.c
    fsf/trunk/libc/posix/posix-envs.def
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/dl-runtime.c
    fsf/trunk/libc/ports/ChangeLog.mips
    fsf/trunk/libc/ports/sysdeps/mips/bits/atomic.h
    fsf/trunk/libc/posix/Makefile
    fsf/trunk/libc/posix/confstr.c
    fsf/trunk/libc/sysdeps/posix/sysconf.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Nov 17 17:27:58 2012
@@ -1,3 +1,31 @@
+2012-11-17  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/fxstatat.c: Include <string.h>.
+
+	* elf/dl-runtime.c [!ELF_MACHINE_NO_PLT]: Make code unconditional.
+
+	* posix/getconf-speclist.c: New file.
+	* posix/posix-envs.def: Likewise.
+	* posix/confstr.c (START_ENV_GROUP): New macro.
+	(END_ENV_GROUP): Likewise.
+	(KNOWN_ABSENT_ENVIRONMENT): Likewise.
+	(KNOWN_PRESENT_ENV_STRING): Likewise.
+	(KNOWN_PRESENT_ENVIRONMENT): Likewise.
+	(UNKNOWN_ENVIRONMENT): Likewise.
+	(confstr): Include posix-envs.def instead of handling
+	_CS_V7_WIDTH_RESTRICTED_ENVS, _CS_V6_WIDTH_RESTRICTED_ENVS and
+	_CS_V5_WIDTH_RESTRICTED_ENVS directly here.
+	* sysdeps/posix/sysconf.c (START_ENV_GROUP): New macro.
+	(END_ENV_GROUP): Likewise.
+	(KNOWN_ABSENT_ENVIRONMENT): Likewise.
+	(KNOWN_PRESENT_ENVIRONMENT): Likewise.
+	(UNKNOWN_ENVIRONMENT): Likewise.
+	(__sysconf): Include posix-envs.def instead of handling associated
+	cases directly here.
+	* posix/Makefile ($(objpfx)getconf.speclist): Generate by
+	preprocessing getconf-speclist.c rather than running getconf or
+	generating empty file.
+
 2012-11-16  Pino Toscano  <toscano.pino@xxxxxxxxxx>
 
 	* scripts/check-local-headers.sh: Ignore 'mach' headers.

Modified: fsf/trunk/libc/elf/dl-runtime.c
==============================================================================
--- fsf/trunk/libc/elf/dl-runtime.c (original)
+++ fsf/trunk/libc/elf/dl-runtime.c Sat Nov 17 17:27:58 2012
@@ -56,7 +56,6 @@
    to that address.  Future calls will bounce directly from the PLT to the
    function.  */
 
-#ifndef ELF_MACHINE_NO_PLT
 DL_FIXUP_VALUE_TYPE
 __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
 _dl_fixup (
@@ -150,9 +149,8 @@
 
   return elf_machine_fixup_plt (l, result, reloc, rel_addr, value);
 }
-#endif
-
-#if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
+
+#if !defined PROF && !__BOUNDED_POINTERS__
 DL_FIXUP_VALUE_TYPE
 __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
 _dl_profile_fixup (
@@ -437,7 +435,7 @@
   return value;
 }
 
-#endif /* PROF && ELF_MACHINE_NO_PLT */
+#endif /* PROF */
 
 
 #include <stdio.h>

Modified: fsf/trunk/libc/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/libc/ports/ChangeLog.mips (original)
+++ fsf/trunk/libc/ports/ChangeLog.mips Sat Nov 17 17:27:58 2012
@@ -1,3 +1,12 @@
+2012-11-17  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/bits/atomic.h
+	(__arch_compare_and_exchange_bool_8_int): Mark __PREV variable
+	with __attribute__ ((unused)).
+	(__arch_compare_and_exchange_bool_16_int): Likewise.
+	(__arch_compare_and_exchange_bool_32_int): Likewise.
+	(__arch_compare_and_exchange_bool_64_int): Likewise.
+
 2012-11-06  Maxim Kuvyrkov  <maxim@xxxxxxxxxxxxxxxx>
 
         * sysdeps/mips/memmove.c: New file.  Use memcpy for forward memmove.

Modified: fsf/trunk/libc/ports/sysdeps/mips/bits/atomic.h
==============================================================================
--- fsf/trunk/libc/ports/sysdeps/mips/bits/atomic.h (original)
+++ fsf/trunk/libc/ports/sysdeps/mips/bits/atomic.h Sat Nov 17 17:27:58 2012
@@ -261,22 +261,22 @@
 /* For all "bool" routines, we return FALSE if exchange succesful.  */
 
 # define __arch_compare_and_exchange_bool_8_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp;					\
+({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp;		\
    __arch_compare_and_exchange_xxx_8_int(mem, new, old, rel, acq);	\
    !__cmp; })
 
 # define __arch_compare_and_exchange_bool_16_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp;					\
+({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp;		\
    __arch_compare_and_exchange_xxx_16_int(mem, new, old, rel, acq);	\
    !__cmp; })
 
 # define __arch_compare_and_exchange_bool_32_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp;					\
+({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp;		\
    __arch_compare_and_exchange_xxx_32_int(mem, new, old, rel, acq);	\
    !__cmp; })
 
 # define __arch_compare_and_exchange_bool_64_int(mem, new, old, rel, acq) \
-({ typeof (*mem) __prev; int __cmp;					\
+({ typeof (*mem) __prev __attribute__ ((unused)); int __cmp;		\
    __arch_compare_and_exchange_xxx_64_int(mem, new, old, rel, acq);	\
    !__cmp; })
 

Modified: fsf/trunk/libc/posix/Makefile
==============================================================================
--- fsf/trunk/libc/posix/Makefile (original)
+++ fsf/trunk/libc/posix/Makefile Sat Nov 17 17:27:58 2012
@@ -298,15 +298,7 @@
 	  mv -f $@/$$spec.new $@/$$spec; \
 	done < $(objpfx)getconf.speclist
 
-$(objpfx)getconf.speclist: $(objpfx)getconf
-ifeq (no,$(cross-compiling))
-	LC_ALL=C GETCONF_DIR=/dev/null \
-	$(run-program-prefix) $< _POSIX_V7_WIDTH_RESTRICTED_ENVS > $@.new
-	LC_ALL=C GETCONF_DIR=/dev/null \
-	$(run-program-prefix) $< _POSIX_V6_WIDTH_RESTRICTED_ENVS >> $@.new
-	LC_ALL=C GETCONF_DIR=/dev/null \
-	$(run-program-prefix) $< _XBS5_WIDTH_RESTRICTED_ENVS >> $@.new
-else
-	> $@.new
-endif
+$(objpfx)getconf.speclist: getconf-speclist.c posix-envs.def
+	$(compile.c) -E -o - \
+	    | sed -n -e '/@@@PRESENT_/s/@@@PRESENT_//p' > $@.new
 	mv -f $@.new $@

Modified: fsf/trunk/libc/posix/confstr.c
==============================================================================
--- fsf/trunk/libc/posix/confstr.c (original)
+++ fsf/trunk/libc/posix/confstr.c Sat Nov 17 17:27:58 2012
@@ -48,182 +48,53 @@
       }
       break;
 
-    case _CS_V7_WIDTH_RESTRICTED_ENVS:
-      /* We have to return a newline-separated list of named of
-	 programming environements in which the widths of blksize_t,
+      /* For _CS_V7_WIDTH_RESTRICTED_ENVS, _CS_V6_WIDTH_RESTRICTED_ENVS
+	 and _CS_V5_WIDTH_RESTRICTED_ENVS:
+
+	 We have to return a newline-separated list of names of
+	 programming environments in which the widths of blksize_t,
 	 cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t,
 	 ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and
 	 wint_t types are no greater than the width of type long.
 
-	 Currently this means all environment which the system allows.  */
+	 Currently this means all environments that the system allows.  */
+
+#define START_ENV_GROUP(VERSION)		\
+    case _CS_##VERSION##_WIDTH_RESTRICTED_ENVS:	\
       string_len = 0;
-#ifndef _POSIX_V7_ILP32_OFF32
-      if (__sysconf (_SC_V7_ILP32_OFF32) > 0)
-#endif
-#if !defined _POSIX_V7_ILP32_OFF32 || _POSIX_V7_ILP32_OFF32 > 0
-	{
-	  memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32",
-		  sizeof "POSIX_V7_ILP32_OFF32" - 1);
-	  string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1;
+
+#define END_ENV_GROUP(VERSION)			\
+      restenvs[string_len++] = '\0';		\
+      string = restenvs;			\
+      break;
+
+#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+      /* Empty.  */
+
+#define KNOWN_PRESENT_ENV_STRING(STR)		\
+      if (string_len > 0)			\
+	restenvs[string_len++] = '\n';		\
+      memcpy (restenvs + string_len, STR,	\
+	      sizeof STR - 1);			\
+      string_len += sizeof STR - 1;
+
+#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+      KNOWN_PRESENT_ENV_STRING (#ENV_PREFIX "_" #SUFFIX)
+
+#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)		\
+      if (__sysconf (_SC_##SC_PREFIX##_##SUFFIX) > 0)			\
+	{								\
+	  KNOWN_PRESENT_ENVIRONMENT (SC_PREFIX, ENV_PREFIX, SUFFIX)	\
 	}
-#endif
-#ifndef _POSIX_V7_ILP32_OFFBIG
-      if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0)
-#endif
-#if !defined _POSIX_V7_ILP32_OFFBIG || _POSIX_V7_ILP32_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG",
-		  sizeof "POSIX_V7_ILP32_OFFBIG" - 1);
-	  string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1;
-	}
-#endif
-#ifndef _POSIX_V7_LP64_OFF64
-      if (__sysconf (_SC_V7_LP64_OFF64) > 0)
-#endif
-#if !defined _POSIX_V7_LP64_OFF64 || _POSIX_V7_LP64_OFF64 > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64",
-		  sizeof "POSIX_V7_LP64_OFF64" - 1);
-	  string_len += sizeof "POSIX_V7_LP64_OFF64" - 1;
-	}
-#endif
-#ifndef _POSIX_V7_LPBIG_OFFBIG
-      if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0)
-#endif
-#if !defined _POSIX_V7_LPBIG_OFFBIG || _POSIX_V7_LPBIG_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG",
-		  sizeof "POSIX_V7_LPBIG_OFFBIG" - 1);
-	  string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1;
-	}
-#endif
-      restenvs[string_len++] = '\0';
-      string = restenvs;
-      break;
-
-    case _CS_V6_WIDTH_RESTRICTED_ENVS:
-      /* We have to return a newline-separated list of named of
-	 programming environements in which the widths of blksize_t,
-	 cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t,
-	 ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and
-	 wint_t types are no greater than the width of type long.
-
-	 Currently this means all environment which the system allows.  */
-      string_len = 0;
-#ifndef _POSIX_V6_ILP32_OFF32
-      if (__sysconf (_SC_V6_ILP32_OFF32) > 0)
-#endif
-#if !defined _POSIX_V6_ILP32_OFF32 || _POSIX_V6_ILP32_OFF32 > 0
-	{
-	  memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32",
-		  sizeof "POSIX_V6_ILP32_OFF32" - 1);
-	  string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1;
-	}
-#endif
-#ifndef _POSIX_V6_ILP32_OFFBIG
-      if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0)
-#endif
-#if !defined _POSIX_V6_ILP32_OFFBIG || _POSIX_V6_ILP32_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG",
-		  sizeof "POSIX_V6_ILP32_OFFBIG" - 1);
-	  string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1;
-	}
-#endif
-#ifndef _POSIX_V6_LP64_OFF64
-      if (__sysconf (_SC_V6_LP64_OFF64) > 0)
-#endif
-#if !defined _POSIX_V6_LP64_OFF64 || _POSIX_V6_LP64_OFF64 > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64",
-		  sizeof "POSIX_V6_LP64_OFF64" - 1);
-	  string_len += sizeof "POSIX_V6_LP64_OFF64" - 1;
-	}
-#endif
-#ifndef _POSIX_V6_LPBIG_OFFBIG
-      if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0)
-#endif
-#if !defined _POSIX_V6_LPBIG_OFFBIG || _POSIX_V6_LPBIG_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG",
-		  sizeof "POSIX_V6_LPBIG_OFFBIG" - 1);
-	  string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1;
-	}
-#endif
-      restenvs[string_len++] = '\0';
-      string = restenvs;
-      break;
-
-    case _CS_V5_WIDTH_RESTRICTED_ENVS:
-      /* We have to return a newline-separated list of named of
-	 programming environements in which the widths of blksize_t,
-	 cc_t, mode_t, nfds_t, pid_t, ptrdiff_t, size_t, speed_t,
-	 ssize_t, suseconds_t, tcflag_t, useconds_t, wchar_t, and
-	 wint_t types are no greater than the width of type long.
-
-	 Currently this means all environment which the system allows.  */
-      string_len = 0;
-#ifndef _XBS5_ILP32_OFF32
-      if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0)
-#endif
-#if !defined _XBS5_ILP32_OFF32 || _XBS5_ILP32_OFF32 > 0
-	{
-	  memcpy (restenvs + string_len, "XBS5_ILP32_OFF32",
-		  sizeof "XBS5_ILP32_OFF32" - 1);
-	  string_len += sizeof "XBS5_ILP32_OFF32" - 1;
-	}
-#endif
-#ifndef _XBS5_ILP32_OFFBIG
-      if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0)
-#endif
-#if !defined _XBS5_ILP32_OFFBIG || _XBS5_ILP32_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG",
-		  sizeof "XBS5_ILP32_OFFBIG" - 1);
-	  string_len += sizeof "XBS5_ILP32_OFFBIG" - 1;
-	}
-#endif
-#ifndef _XBS5_LP64_OFF64
-      if (__sysconf (_SC_XBS5_LP64_OFF64) > 0)
-#endif
-#if !defined _XBS5_LP64_OFF64 || _XBS5_LP64_OFF64 > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "XBS5_LP64_OFF64",
-		  sizeof "XBS5_LP64_OFF64" - 1);
-	  string_len += sizeof "XBS5_LP64_OFF64" - 1;
-	}
-#endif
-#ifndef _XBS5_LPBIG_OFFBIG
-      if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0)
-#endif
-#if !defined _XBS5_LPBIG_OFFBIG || _XBS5_LPBIG_OFFBIG > 0
-	{
-	  if (string_len)
-	    restenvs[string_len++] = '\n';
-	  memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG",
-		  sizeof "XBS5_LPBIG_OFFBIG" - 1);
-	  string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1;
-	}
-#endif
-      restenvs[string_len++] = '\0';
-      string = restenvs;
-      break;
+
+#include "posix-envs.def"
+
+#undef START_ENV_GROUP
+#undef END_ENV_GROUP
+#undef KNOWN_ABSENT_ENVIRONMENT
+#undef KNOWN_PRESENT_ENV_STRING
+#undef KNOWN_PRESENT_ENVIRONMENT
+#undef UNKNOWN_ENVIRONMENT
 
     case _CS_XBS5_ILP32_OFF32_CFLAGS:
     case _CS_POSIX_V6_ILP32_OFF32_CFLAGS:

Added: fsf/trunk/libc/posix/getconf-speclist.c
==============================================================================
--- fsf/trunk/libc/posix/getconf-speclist.c (added)
+++ fsf/trunk/libc/posix/getconf-speclist.c Sat Nov 17 17:27:58 2012
@@ -1,0 +1,42 @@
+/* List POSIX compilation environments for this libc.
+   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
+   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 <unistd.h>
+
+#define START_ENV_GROUP(VERSION)		\
+  /* Empty.  */
+
+#define END_ENV_GROUP(VERSION)			\
+  /* Empty.  */
+
+#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+  /* Empty.  */
+
+#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+  @@@PRESENT_##ENV_PREFIX##_##SUFFIX
+
+#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+  /* Empty.  */
+
+#include "posix-envs.def"
+
+#undef START_ENV_GROUP
+#undef END_ENV_GROUP
+#undef KNOWN_ABSENT_ENVIRONMENT
+#undef KNOWN_PRESENT_ENVIRONMENT
+#undef UNKNOWN_ENVIRONMENT

Added: fsf/trunk/libc/posix/posix-envs.def
==============================================================================
--- fsf/trunk/libc/posix/posix-envs.def (added)
+++ fsf/trunk/libc/posix/posix-envs.def Sat Nov 17 17:27:58 2012
@@ -1,0 +1,151 @@
+/* Handle POSIX compilation environments that may or may not be present.
+   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
+   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/>.  */
+
+/* Before including this file, the including file must have included
+   <bits/environments.h> (generally via <unistd.h>) and must have
+   defined the following macros, exactly one of which will be called
+   for each POSIX environment:
+
+   KNOWN_PRESENT_ENVIRONMENT, for POSIX environments that are known to
+   be supported in this libc.
+
+   KNOWN_ABSENT_ENVIRONMENT, for POSIX environments that are known not
+   to be supported on this system.
+
+   UNKNOWN_ENVIRONMENT, for POSIX environments not supported in this
+   libc but possibly supported by another libc on the same system,
+   that can be selected using the same compiler but different
+   compilation options.
+
+   Each macro has arguments (SC_PREFIX, ENV_PREFIX, SUFFIX).  The
+   corresponding argument to sysconf is _SC_##SC_PREFIX##_##SUFFIX.
+   The environment name, as used with getconf, is
+   ENV_PREFIX##_##SUFFIX, and the corresponding macro is the same with
+   a leading "_".
+
+   In addition, the macros START_ENV_GROUP and END_ENV_GROUP must be
+   defined.  These are called with arguments V5, V6, V7 before and
+   after the relevant groups of environments.  */
+
+START_ENV_GROUP (V7)
+
+#if _POSIX_V7_ILP32_OFF32 > 0
+KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32)
+#elif defined _POSIX_V7_ILP32_OFF32
+KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32)
+#else
+UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFF32)
+#endif
+
+#if _POSIX_V7_ILP32_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG)
+#elif defined _POSIX_V7_ILP32_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (V7, POSIX_V7, ILP32_OFFBIG)
+#endif
+
+#if _POSIX_V7_LP64_OFF64 > 0
+KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64)
+#elif defined _POSIX_V7_LP64_OFF64
+KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64)
+#else
+UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LP64_OFF64)
+#endif
+
+#if _POSIX_V7_LPBIG_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG)
+#elif defined _POSIX_V7_LPBIG_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (V7, POSIX_V7, LPBIG_OFFBIG)
+#endif
+
+END_ENV_GROUP (V7)
+
+START_ENV_GROUP (V6)
+
+#if _POSIX_V6_ILP32_OFF32 > 0
+KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32)
+#elif defined _POSIX_V6_ILP32_OFF32
+KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32)
+#else
+UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFF32)
+#endif
+
+#if _POSIX_V6_ILP32_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG)
+#elif defined _POSIX_V6_ILP32_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (V6, POSIX_V6, ILP32_OFFBIG)
+#endif
+
+#if _POSIX_V6_LP64_OFF64 > 0
+KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64)
+#elif defined _POSIX_V6_LP64_OFF64
+KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64)
+#else
+UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LP64_OFF64)
+#endif
+
+#if _POSIX_V6_LPBIG_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG)
+#elif defined _POSIX_V6_LPBIG_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (V6, POSIX_V6, LPBIG_OFFBIG)
+#endif
+
+END_ENV_GROUP (V6)
+
+START_ENV_GROUP (V5)
+
+#if _XBS5_ILP32_OFF32 > 0
+KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32)
+#elif defined _XBS5_ILP32_OFF32
+KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32)
+#else
+UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFF32)
+#endif
+
+#if _XBS5_ILP32_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG)
+#elif defined _XBS5_ILP32_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (XBS5, XBS5, ILP32_OFFBIG)
+#endif
+
+#if _XBS5_LP64_OFF64 > 0
+KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64)
+#elif defined _XBS5_LP64_OFF64
+KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LP64_OFF64)
+#else
+UNKNOWN_ENVIRONMENT (XBS5, XBS5, LP64_OFF64)
+#endif
+
+#if _XBS5_LPBIG_OFFBIG > 0
+KNOWN_PRESENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG)
+#elif defined _XBS5_LPBIG_OFFBIG
+KNOWN_ABSENT_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG)
+#else
+UNKNOWN_ENVIRONMENT (XBS5, XBS5, LPBIG_OFFBIG)
+#endif
+
+END_ENV_GROUP (V5)

Modified: fsf/trunk/libc/sysdeps/posix/sysconf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/sysconf.c (original)
+++ fsf/trunk/libc/sysdeps/posix/sysconf.c Sat Nov 17 17:27:58 2012
@@ -790,80 +790,31 @@
       return -1;
 #endif
 
-    case _SC_XBS5_ILP32_OFF32:
-#ifdef _XBS5_ILP32_OFF32
-      return _XBS5_ILP32_OFF32;
-#else
-      return __sysconf_check_spec ("ILP32_OFF32");
-#endif
-    case _SC_XBS5_ILP32_OFFBIG:
-#ifdef _XBS5_ILP32_OFFBIG
-      return _XBS5_ILP32_OFFBIG;
-#else
-      return __sysconf_check_spec ("ILP32_OFFBIG");
-#endif
-    case _SC_XBS5_LP64_OFF64:
-#ifdef _XBS5_LP64_OFF64
-      return _XBS5_LP64_OFF64;
-#else
-      return __sysconf_check_spec ("LP64_OFF64");
-#endif
-    case _SC_XBS5_LPBIG_OFFBIG:
-#ifdef _XBS5_LPBIG_OFFBIG
-      return _XBS5_LPBIG_OFFBIG;
-#else
-      return __sysconf_check_spec ("LPBIG_OFFBIG");
-#endif
-
-    case _SC_V6_ILP32_OFF32:
-#ifdef _POSIX_V6_ILP32_OFF32
-      return _POSIX_V6_ILP32_OFF32;
-#else
-      return __sysconf_check_spec ("ILP32_OFF32");
-#endif
-    case _SC_V6_ILP32_OFFBIG:
-#ifdef _POSIX_V6_ILP32_OFFBIG
-      return _POSIX_V6_ILP32_OFFBIG;
-#else
-      return __sysconf_check_spec ("ILP32_OFFBIG");
-#endif
-    case _SC_V6_LP64_OFF64:
-#ifdef _POSIX_V6_LP64_OFF64
-      return _POSIX_V6_LP64_OFF64;
-#else
-      return __sysconf_check_spec ("LP64_OFF64");
-#endif
-    case _SC_V6_LPBIG_OFFBIG:
-#ifdef _POSIX_V6_LPBIG_OFFBIG
-      return _POSIX_V6_LPBIG_OFFBIG;
-#else
-      return __sysconf_check_spec ("LPBIG_OFFBIG");
-#endif
-
-    case _SC_V7_ILP32_OFF32:
-#ifdef _POSIX_V7_ILP32_OFF32
-      return _POSIX_V7_ILP32_OFF32;
-#else
-      return __sysconf_check_spec ("ILP32_OFF32");
-#endif
-    case _SC_V7_ILP32_OFFBIG:
-#ifdef _POSIX_V7_ILP32_OFFBIG
-      return _POSIX_V7_ILP32_OFFBIG;
-#else
-      return __sysconf_check_spec ("ILP32_OFFBIG");
-#endif
-    case _SC_V7_LP64_OFF64:
-#ifdef _POSIX_V7_LP64_OFF64
-      return _POSIX_V7_LP64_OFF64;
-#else
-      return __sysconf_check_spec ("LP64_OFF64");
-#endif
-    case _SC_V7_LPBIG_OFFBIG:
-#ifdef _POSIX_V7_LPBIG_OFFBIG
-      return _POSIX_V7_LPBIG_OFFBIG;
-#else
-      return __sysconf_check_spec ("LPBIG_OFFBIG");
-#endif
+#define START_ENV_GROUP(VERSION)		\
+      /* Empty.  */
+
+#define END_ENV_GROUP(VERSION)			\
+      /* Empty.  */
+
+#define KNOWN_ABSENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+    case _SC_##SC_PREFIX##_##SUFFIX:				\
+      return _##ENV_PREFIX##_##SUFFIX;
+
+#define KNOWN_PRESENT_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+    case _SC_##SC_PREFIX##_##SUFFIX:					\
+      return _##ENV_PREFIX##_##SUFFIX;
+
+#define UNKNOWN_ENVIRONMENT(SC_PREFIX, ENV_PREFIX, SUFFIX)	\
+    case _SC_##SC_PREFIX##_##SUFFIX:				\
+      return __sysconf_check_spec (#SUFFIX);
+
+#include <posix/posix-envs.def>
+
+#undef START_ENV_GROUP
+#undef END_ENV_GROUP
+#undef KNOWN_ABSENT_ENVIRONMENT
+#undef KNOWN_PRESENT_ENVIRONMENT
+#undef UNKNOWN_ENVIRONMENT
 
     case _SC_XOPEN_LEGACY:
       return _XOPEN_LEGACY;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/fxstatat.c Sat Nov 17 17:27:58 2012
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005-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
@@ -23,6 +23,7 @@
 #include <fcntl.h>
 #include <stddef.h>
 #include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <kernel_stat.h>
 

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits