[PATCH 4/4] winsup/utils: port getconf to 64-bit
Yaakov Selkowitz
yselkowi@redhat.com
Fri Apr 1 23:40:00 GMT 2016
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>
---
winsup/utils/getconf.c | 35 +++++++++++++++++++++++------------
1 file changed, 23 insertions(+), 12 deletions(-)
diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 8732be1..993aa29 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 */
--
2.7.4
More information about the Cygwin-patches
mailing list