[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 35/41] procfs: Port to x86_64
From: |
Sergey Bugaev |
Subject: |
[PATCH 35/41] procfs: Port to x86_64 |
Date: |
Tue, 9 May 2023 00:31:30 +0300 |
---
procfs/process.c | 18 +++++++++---------
procfs/rootdir.c | 8 ++++----
2 files changed, 13 insertions(+), 13 deletions(-)
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),
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index 45e228c8..1c7181b1 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -560,7 +560,7 @@ rootdir_gc_hostinfo (void *hook, char **contents, ssize_t
*contents_len)
fprintf (m, "Basic info:\n"
"max_cpus = %10u /* max number of cpus possible */\n"
"avail_cpus = %10u /* number of cpus now available */\n"
- "memory_size = %10u /* size of memory in bytes */\n"
+ "memory_size = %10zu /* size of memory in bytes */\n"
"cpu_type = %10u /* cpu type */\n"
"cpu_subtype = %10u /* cpu subtype */\n",
basic->max_cpus,
@@ -651,11 +651,11 @@ rootdir_gc_swaps (void *hook, char **contents, ssize_t
*contents_len)
error_t err = 0;
FILE *m;
vm_size_t *free = NULL;
- size_t nfree = 0;
+ mach_msg_type_number_t nfree = 0;
vm_size_t *size = NULL;
- size_t nsize = 0;
+ mach_msg_type_number_t nsize = 0;
char *names = NULL, *name;
- size_t names_len = 0;
+ mach_msg_type_number_t names_len = 0;
size_t i;
m = open_memstream (contents, (size_t *) contents_len);
--
2.40.1
- Re: [PATCH 12/41] libps: Silence a warning, (continued)
- [PATCH 11/41] libps: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 32/41] tmpfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 29/41] pflocal: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 14/41] utils: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 17/41] proc: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 16/41] auth: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 26/41] boot: Fix use-after-realloc, Sergey Bugaev, 2023/05/08
- [PATCH 20/41] elfcore: Add support for saving x86_64 registers, Sergey Bugaev, 2023/05/08
- [PATCH 22/41] sutils: Avoid warnings about prototype mismatch, Sergey Bugaev, 2023/05/08
- [PATCH 35/41] procfs: Port to x86_64,
Sergey Bugaev <=
- [PATCH 41/41] Style tweaks, Sergey Bugaev, 2023/05/08
- [PATCH 34/41] ext2fs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 33/41] fatfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 21/41] sutils: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 27/41] boot: Port to x64_64, Sergey Bugaev, 2023/05/08
- [PATCH 37/41] console-client: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 30/41] startup: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 15/41] utils: Avoid warnings about prototype mismatch, Sergey Bugaev, 2023/05/08
- [PATCH 18/41] proc: Fix use-after-realloc, Sergey Bugaev, 2023/05/08
- [PATCH 31/41] mach-defpager: Port to x86_64, Sergey Bugaev, 2023/05/08