From aad76968cd5934ee17f36cd8e817e86ae952b533 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 30 Dec 2018 20:24:59 +0100 Subject: pmap: make 32-bit version work better on 64-bit kernels Signed-off-by: Denys Vlasenko --- procps/pmap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'procps') diff --git a/procps/pmap.c b/procps/pmap.c index c8fa0d280..9e541c707 100644 --- a/procps/pmap.c +++ b/procps/pmap.c @@ -37,6 +37,12 @@ # define DASHES "--------" #endif +#if ULLONG_MAX == 0xffffffff +# define AFMTLL "8" +#else +# define AFMTLL "16" +#endif + enum { OPT_x = 1 << 0, OPT_q = 1 << 1, @@ -46,7 +52,7 @@ static void print_smaprec(struct smaprec *currec, void *data) { unsigned opt = (uintptr_t)data; - printf("%0" AFMT "lx ", currec->smap_start); + printf("%0" AFMTLL "llx ", currec->smap_start); if (opt & OPT_x) printf("%7lu %7lu %7lu %7lu ", -- cgit v1.2.3