From 45ad42f1288d2733a648825f9a2f86314775b79a Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 9 May 2023 00:31:30 +0300 Subject: procfs: Port to x86_64 Message-Id: <20230508213136.608575-36-bugaevc@gmail.com> --- procfs/process.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'procfs/process.c') diff --git a/procfs/process.c b/procfs/process.c index eaf5f45b..3170b775 100644 --- a/procfs/process.c +++ b/procfs/process.c @@ -162,17 +162,17 @@ process_file_gc_maps (struct proc_stat *ps, char **contents) if (err) break; - fprintf (s, "%0*lx-%0*lx %c%c%c%c %0*lx %s %d ", + fprintf (s, "%0*zx-%0*zx %c%c%c%c %0*zx %s %d ", /* Address range. */ - 2*sizeof s, addr, - 2*sizeof s, addr + size, + (int) (2 * sizeof s), addr, + (int) (2 * sizeof s), addr + size, /* Permissions. */ prot & VM_PROT_READ? 'r': '-', prot & VM_PROT_WRITE? 'w': '-', prot & VM_PROT_EXECUTE? 'x': '-', shared? 's': 'p', /* Offset. */ - 2*sizeof s, offs, + (int) (2 * sizeof s), offs, /* Device. */ "00:00", /* Inode. */ @@ -266,7 +266,7 @@ process_file_gc_stat (struct proc_stat *ps, char **contents) "%d %ld " /* number of threads, [obsolete] */ "%llu " /* start time since boot (jiffies) */ "%lu %ld %lu " /* virtual size (bytes), rss (pages), rss lim */ - "%lu %lu %lu %lu %lu " /* some vm addresses (code, stack, sp, pc) */ + "%zu %zu %lu %lu %lu " /* some vm addresses (code, stack, sp, pc) */ "%lu %lu %lu %lu " /* pending, blocked, ignored and caught sigs */ "%lu " /* wait channel */ "%lu %lu " /* swap usage (not maintained in Linux) */ @@ -325,10 +325,10 @@ process_file_gc_status (struct proc_stat *ps, char **contents) "Pid:\t%u\n" "PPid:\t%u\n" "Uid:\t%u\t%u\t%u\t%u\n" - "VmSize:\t%8u kB\n" - "VmPeak:\t%8u kB\n" - "VmRSS:\t%8u kB\n" - "VmHWM:\t%8u kB\n" /* ie. resident peak */ + "VmSize:\t%8zu kB\n" + "VmPeak:\t%8zu kB\n" + "VmRSS:\t%8zu kB\n" + "VmHWM:\t%8zu kB\n" /* ie. resident peak */ "Threads:\t%u\n", args_filename_length (fn), fn, state_string (ps), -- cgit v1.2.3