summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/confstr.c2
-rw-r--r--posix/getconf.c20
-rw-r--r--posix/posix-conf-vars.list9
-rw-r--r--posix/posix-envs.def1
4 files changed, 11 insertions, 21 deletions
diff --git a/posix/confstr.c b/posix/confstr.c
index e4e0f4bdec..244a25c93f 100644
--- a/posix/confstr.c
+++ b/posix/confstr.c
@@ -21,6 +21,8 @@
#include <string.h>
#include <confstr.h>
#include "../version.h"
+
+#define NEED_SPEC_ARRAY 0
#include <posix-conf-vars.h>
/* If BUF is not NULL and LEN > 0, fill in at most LEN - 1 bytes
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;
diff --git a/posix/posix-conf-vars.list b/posix/posix-conf-vars.list
index 3e7e7cdaa9..601bc2fd33 100644
--- a/posix/posix-conf-vars.list
+++ b/posix/posix-conf-vars.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
@@ -104,7 +105,7 @@ SYSCONF POSIX {
RAW_SOCKETS
}
-SPEC XBS5 {
+SPEC XBS5 _SC_XBS5 {
ILP32_OFF32
ILP32_OFFBIG
LP64_OFF64
diff --git a/posix/posix-envs.def b/posix/posix-envs.def
index 870d85a7db..fa271bbfc4 100644
--- a/posix/posix-envs.def
+++ b/posix/posix-envs.def
@@ -42,6 +42,7 @@
defined. These are called with arguments V5, V6, V7 before and
after the relevant groups of environments. */
+#define NEED_SPEC_ARRAY 0
#include <posix-conf-vars.h>
START_ENV_GROUP (V7)