Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2016-04-02 01:44:31 +0300
committerYaakov Selkowitz <yselkowi@redhat.com>2016-04-04 18:25:39 +0300
commit8502abb674e23e976ebdb85fb07934dd01172506 (patch)
treed5e5b67caf71b5af85c71b342cd48e6c62c93ab8 /winsup/utils
parent959d58ea7cb2bc7ed8ab4c804fc1d72a0f5ad01d (diff)
winsup/utils: port getconf to 64-bit
The available specifications obviously differ on 32-bit and 64-bit, as already handled in <sys/features.h>. Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/getconf.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 8732be172..993aa29fa 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -385,22 +385,33 @@ struct spec_variable {
int valid;
};
+#if __LP64__
+#define ILP32 0
+#define LP64 1
+#else
+#define ILP32 1
+#define LP64 0
+#endif
+
static const struct spec_variable spec_table[] = {
- { "POSIX_V7_ILP32_OFF32", 0 },
- { "POSIX_V7_ILP32_OFFBIG", 1 },
- { "POSIX_V7_LP64_OFF64", 0 },
- { "POSIX_V7_LPBIG_OFFBIG", 0 },
- { "POSIX_V6_ILP32_OFF32", 0 },
- { "POSIX_V6_ILP32_OFFBIG", 1 },
- { "POSIX_V6_LP64_OFF64", 0 },
- { "POSIX_V6_LPBIG_OFFBIG", 0 },
- { "XBS5_ILP32_OFF32", 0 },
- { "XBS5_ILP32_OFFBIG", 1 },
- { "XBS5_LP64_OFF64", 0 },
- { "XBS5_LPBIG_OFFBIG", 0 },
+ { "POSIX_V7_ILP32_OFF32", 0 },
+ { "POSIX_V7_ILP32_OFFBIG", ILP32 },
+ { "POSIX_V7_LP64_OFF64", LP64 },
+ { "POSIX_V7_LPBIG_OFFBIG", LP64 },
+ { "POSIX_V6_ILP32_OFF32", 0 },
+ { "POSIX_V6_ILP32_OFFBIG", ILP32 },
+ { "POSIX_V6_LP64_OFF64", LP64 },
+ { "POSIX_V6_LPBIG_OFFBIG", LP64 },
+ { "XBS5_ILP32_OFF32", 0 },
+ { "XBS5_ILP32_OFFBIG", ILP32 },
+ { "XBS5_LP64_OFF64", LP64 },
+ { "XBS5_LPBIG_OFFBIG", LP64 },
{ NULL, 0 },
};
+#undef ILP32
+#undef LP64
+
static int a_flag = 0; /* list all variables */
static int v_flag = 0; /* follow given specification */