pmap: make 32-bit version work better on 64-bit kernels

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-12-30 20:24:59 +01:00
parent 8b710ef000
commit aad76968cd
3 changed files with 17 additions and 6 deletions

View File

@@ -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 ",