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>
This commit is contained in:
Yaakov Selkowitz 2016-04-01 17:44:31 -05:00
parent 959d58ea7c
commit 8502abb674
1 changed files with 23 additions and 12 deletions

View File

@ -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 */