aboutsummaryrefslogtreecommitdiff
path: root/posix/getconf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-02-07 08:19:29 +0000
committerUlrich Drepper <drepper@redhat.com>2009-02-07 08:19:29 +0000
commit26b62243eed34c3ce43da0ea9e469ecc38a73968 (patch)
treefc6a01de2386c131c4f96cad17ec877d2df4bf53 /posix/getconf.c
parent962edb7e689847d5eb9b94a351fd0457994227f0 (diff)
downloadglibc-26b62243eed34c3ce43da0ea9e469ecc38a73968.zip
glibc-26b62243eed34c3ce43da0ea9e469ecc38a73968.tar.gz
glibc-26b62243eed34c3ce43da0ea9e469ecc38a73968.tar.bz2
[BZ #7095]
2009-02-06 Ulrich Drepper <drepper@redhat.com> [BZ #7095] * bits/confname.h: Add SUSv7 macros for getconf environments. * bits/environments.h: Likewise. * sysdeps/unix/sysv/linux/i386/bits/environments.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/environments.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/environments.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/environments.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/environments.h: Likewise. * posix/confstr.c: Handle SUSv5 and SUSv7 environments. * posix/getconf.c: Likewise. * posix/sysconf.c: Likewise. * sysdeps/posix/sysconf.c: Likewise. * posix/Makefile (getconf.speclist): Also collect SUSv5 and SUSv7 environments.
Diffstat (limited to 'posix/getconf.c')
-rw-r--r--posix/getconf.c111
1 files changed, 109 insertions, 2 deletions
diff --git a/posix/getconf.c b/posix/getconf.c
index 1b5f6bc..2b1f6c9 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -528,6 +528,11 @@ static const struct conf vars[] =
#endif
/* Programming environments. */
+#ifdef _CS_V5_WIDTH_RESTRICTED_ENVS
+ { "_XBS5_WIDTH_RESTRICTED_ENVS", _CS_V5_WIDTH_RESTRICTED_ENVS, CONFSTR },
+ { "XBS5_WIDTH_RESTRICTED_ENVS", _CS_V5_WIDTH_RESTRICTED_ENVS, CONFSTR },
+#endif
+
#ifdef _SC_XBS5_ILP32_OFF32
{ "_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32, SYSCONF },
#endif
@@ -661,6 +666,75 @@ static const struct conf vars[] =
{ "POSIX_V6_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, CONFSTR },
#endif
+#ifdef _SC_V7_ILP32_OFF32
+ { "_POSIX_V7_ILP32_OFF32", _SC_V7_ILP32_OFF32, SYSCONF },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFF32_CFLAGS
+ { "POSIX_V7_ILP32_OFF32_CFLAGS", _CS_POSIX_V7_ILP32_OFF32_CFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
+ { "POSIX_V7_ILP32_OFF32_LDFLAGS", _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFF32_LIBS
+ { "POSIX_V7_ILP32_OFF32_LIBS", _CS_POSIX_V7_ILP32_OFF32_LIBS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS
+ { "POSIX_V7_ILP32_OFF32_LINTFLAGS", _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, CONFSTR },
+#endif
+
+#ifdef _CS_V7_WIDTH_RESTRICTED_ENVS
+ { "_POSIX_V7_WIDTH_RESTRICTED_ENVS", _CS_V7_WIDTH_RESTRICTED_ENVS, CONFSTR },
+ { "POSIX_V7_WIDTH_RESTRICTED_ENVS", _CS_V7_WIDTH_RESTRICTED_ENVS, CONFSTR },
+#endif
+
+#ifdef _SC_V7_ILP32_OFFBIG
+ { "_POSIX_V7_ILP32_OFFBIG", _SC_V7_ILP32_OFFBIG, SYSCONF },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
+ { "POSIX_V7_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
+ { "POSIX_V7_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFFBIG_LIBS
+ { "POSIX_V7_ILP32_OFFBIG_LIBS", _CS_POSIX_V7_ILP32_OFFBIG_LIBS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS
+ { "POSIX_V7_ILP32_OFFBIG_LINTFLAGS", _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, CONFSTR },
+#endif
+
+#ifdef _SC_V7_LP64_OFF64
+ { "_POSIX_V7_LP64_OFF64", _SC_V7_LP64_OFF64, SYSCONF },
+#endif
+#ifdef _CS_POSIX_V7_LP64_OFF64_CFLAGS
+ { "POSIX_V7_LP64_OFF64_CFLAGS", _CS_POSIX_V7_LP64_OFF64_CFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LP64_OFF64_LDFLAGS
+ { "POSIX_V7_LP64_OFF64_LDFLAGS", _CS_POSIX_V7_LP64_OFF64_LDFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LP64_OFF64_LIBS
+ { "POSIX_V7_LP64_OFF64_LIBS", _CS_POSIX_V7_LP64_OFF64_LIBS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LP64_OFF64_LINTFLAGS
+ { "POSIX_V7_LP64_OFF64_LINTFLAGS", _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, CONFSTR },
+#endif
+
+#ifdef _SC_V7_LPBIG_OFFBIG
+ { "_POSIX_V7_LPBIG_OFFBIG", _SC_V7_LPBIG_OFFBIG, SYSCONF },
+#endif
+#ifdef _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
+ { "POSIX_V7_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
+ { "POSIX_V7_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
+ { "POSIX_V7_LPBIG_OFFBIG_LIBS", _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, CONFSTR },
+#endif
+#ifdef _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS
+ { "POSIX_V7_LPBIG_OFFBIG_LINTFLAGS", _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, CONFSTR },
+#endif
+
#ifdef _SC_ADVISORY_INFO
{ "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, SYSCONF },
#endif
@@ -926,12 +1000,20 @@ static const struct conf vars[] =
};
-static struct { const char *name; int num; } specs[] =
+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_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]);
@@ -949,6 +1031,7 @@ usage (void)
exit (2);
}
+
static void
print_all (const char *path)
{
@@ -1082,6 +1165,18 @@ environment SPEC.\n\n"));
switch (specs[i].num)
{
+#ifndef _XBS5_ILP32_OFF32
+ case _SC_XBS5_ILP32_OFF32:
+#endif
+#ifndef _XBS5_ILP32_OFFBIG
+ case _SC_XBS5_ILP32_OFFBIG:
+#endif
+#ifndef _XBS5_LP64_OFF64
+ case _SC_XBS5_LP64_OFF64:
+#endif
+#ifndef _XBS5_LPBIG_OFFBIG
+ case _SC_XBS5_LPBIG_OFFBIG:
+#endif
#ifndef _POSIX_V6_ILP32_OFF32
case _SC_V6_ILP32_OFF32:
#endif
@@ -1094,6 +1189,18 @@ environment SPEC.\n\n"));
#ifndef _POSIX_V6_LPBIG_OFFBIG
case _SC_V6_LPBIG_OFFBIG:
#endif
+#ifndef _POSIX_V7_ILP32_OFF32
+ case _SC_V7_ILP32_OFF32:
+#endif
+#ifndef _POSIX_V7_ILP32_OFFBIG
+ case _SC_V7_ILP32_OFFBIG:
+#endif
+#ifndef _POSIX_V7_LP64_OFF64
+ case _SC_V7_LP64_OFF64:
+#endif
+#ifndef _POSIX_V7_LPBIG_OFFBIG
+ case _SC_V7_LPBIG_OFFBIG:
+#endif
{
const char *args[argc + 3];
size_t spec_len = strlen (spec);