about summary refs log tree commit diff
path: root/posix/getconf.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-12-29 17:40:47 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-12-29 19:56:27 +0530
commit50cbbaa935e92dc570fc899a17669cd6782b09cd (patch)
treeb3df9300b25996e350aaf3774f11c5d8e0ee4a7d /posix/getconf.c
parent3b566046c3e8cb252f4c0ab7b6041fef5098f1a5 (diff)
downloadglibc-50cbbaa935e92dc570fc899a17669cd6782b09cd.tar.gz
glibc-50cbbaa935e92dc570fc899a17669cd6782b09cd.tar.xz
glibc-50cbbaa935e92dc570fc899a17669cd6782b09cd.zip
Use posix-conf-vars.list to generate spec array
This patch adds support to generate the spec array in getconf from the
conf.list.  The generated code is mostly unchanged.  the only changes
are due to the change in layout of the spec and val arrays in the ELF.

The val array can also be auto-generated from posix-conf-vars.list
once the remaining macros are added to it.

	* posix/posix-conf-vars.list (SPEC:XBS5): Add sysconf prefix.
	* posix/confstr.c: Define NEED_SPEC_ARRAY to 0.
	* posix/posix-envs.def: Likewise.
	* sysdeps/posix/sysconf.c: Likewise.
	* posix/getconf.c: Define NEED_SPEC_ARRAY to 1.
	(specs): Remove array.
	* scripts/gen-posix-conf-vars.awk: Support generation of specs
	array.
Diffstat (limited to 'posix/getconf.c')
-rw-r--r--posix/getconf.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/posix/getconf.c b/posix/getconf.c
index 14d51d87ac..bcde4c58a1 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -26,6 +26,9 @@
 #include "../version.h"
 #define PACKAGE _libc_intl_domainname
 
+#define NEED_SPEC_ARRAY 1
+#include <posix-conf-vars.h>
+
 struct conf
   {
     const char *name;
@@ -387,23 +390,6 @@ static const struct conf vars[] =
   };
 
 
-static const struct { const char *name; int num; } specs[] =
-  {
-    { "XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32 },
-    { "XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG },
-    { "XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64 },
-    { "XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG },
-    { "POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32 },
-    { "POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG },
-    { "POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64 },
-    { "POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG },
-    { "POSIX_V7_ILP32_OFF32", _SC_V7_ILP32_OFF32 },
-    { "POSIX_V7_ILP32_OFFBIG", _SC_V7_ILP32_OFFBIG },
-    { "POSIX_V7_LP64_OFF64", _SC_V7_LP64_OFF64 },
-    { "POSIX_V7_LPBIG_OFFBIG", _SC_V7_LPBIG_OFFBIG },
-  };
-static const int nspecs = sizeof (specs) / sizeof (specs[0]);
-
 extern const char *__progname;