diff options
-rw-r--r-- | mincore.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -9,6 +9,8 @@ static void mincore_stats(const char *path) size_t map_len; int fd; size_t i; + static const char *fmt = sizeof(void *) == 8 ? + "%s: %016lu %x\n": "%s: %08lu %x\n"; if ((fd = open(path, O_RDONLY|O_NOATIME)) < 0) { fprintf(stderr, "%s: open(): %s\n", path, strerror(errno)); @@ -42,9 +44,7 @@ static void mincore_stats(const char *path) } for (i = 0; i < vec_len; ++i) - printf("%s: [%08lu] %x\n", - path, (unsigned long)i, - (vec[i])); + printf(fmt, path, (unsigned long)(page_size() * i), vec[i]); err_munmap: munmap(map, map_len); err_free: |