diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-10-01 14:36:03 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2014-12-15 11:03:33 +0530 |
commit | 41868acc3a55bad110e79a7a40c030b39c5480bb (patch) | |
tree | 9153591b1d908064b0533a33abb65bad7f99f3f3 /posix | |
parent | 67cf3c6ed0b1119bbddc1c6f46af486fc1ad2432 (diff) | |
download | glibc-siddhesh/posix-wundef.tar glibc-siddhesh/posix-wundef.tar.gz glibc-siddhesh/posix-wundef.tar.bz2 glibc-siddhesh/posix-wundef.zip |
Use conf.list to generate spec arraysiddhesh/posix-wundef
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 conf.list once the
remaining macros are added to it.
* posix/conf.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-conf.awk: Support generation of specs array.
Diffstat (limited to 'posix')
-rw-r--r-- | posix/conf.list | 9 | ||||
-rw-r--r-- | posix/confstr.c | 4 | ||||
-rw-r--r-- | posix/getconf.c | 20 | ||||
-rw-r--r-- | posix/posix-envs.def | 3 |
4 files changed, 13 insertions, 23 deletions
diff --git a/posix/conf.list b/posix/conf.list index 000b90893a..0a17666d8d 100644 --- a/posix/conf.list +++ b/posix/conf.list @@ -1,7 +1,8 @@ # Configuration variables identified by getconf. The heading of each section -# is of the format TYPE:PREFIX with the opening curly brace on the same line. -# TYPE can either be SYSCONF, PATHCONF, CONFSTR or SPEC. Variable names are -# put one on each line with a curly brace on its own line ending the section. +# is of the format TYPE:PREFIX:SC_PREFIX with the opening curly brace on the +# same line. TYPE can either be SYSCONF, PATHCONF, CONFSTR or SPEC. In the +# absence of SC_PREFIX, _SC is used as the SC_PREFIX. Variable names are put +# one on each line with a curly brace on its own line ending the section. SPEC:POSIX { V6_ILP32_OFF32 @@ -103,7 +104,7 @@ SYSCONF:POSIX { RAW_SOCKETS } -SPEC:XBS5 { +SPEC:XBS5:_SC_XBS5 { ILP32_OFF32 ILP32_OFFBIG LP64_OFF64 diff --git a/posix/confstr.c b/posix/confstr.c index 1accfeead0..0400d7f247 100644 --- a/posix/confstr.c +++ b/posix/confstr.c @@ -21,7 +21,9 @@ #include <string.h> #include <confstr.h> #include "../version.h" -#include "confdefs.h" + +#define NEED_SPEC_ARRAY 0 +#include <confdefs.h> /* If BUF is not NULL and LEN > 0, fill in at most LEN - 1 bytes of BUF with the value corresponding to NAME and zero-terminate BUF. diff --git a/posix/getconf.c b/posix/getconf.c index 14d51d87ac..3c086880a2 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 <confdefs.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; diff --git a/posix/posix-envs.def b/posix/posix-envs.def index 9047d0ce89..0b33e02884 100644 --- a/posix/posix-envs.def +++ b/posix/posix-envs.def @@ -42,7 +42,8 @@ defined. These are called with arguments V5, V6, V7 before and after the relevant groups of environments. */ -#include "confdefs.h" +#define NEED_SPEC_ARRAY 0 +#include <confdefs.h> START_ENV_GROUP (V7) |