summaryrefslogtreecommitdiffstats
path: root/ksysguard/ksysguardd/Linux/ProcessList.c
diff options
context:
space:
mode:
authorDaniel Collins <[email protected]>2023-05-27 17:39:13 +0100
committerMichele Calgaro <[email protected]>2023-05-30 09:54:43 +0900
commit0598cdf67a4eab412e8e806fbdef4ec9f2769df3 (patch)
tree604acbb35712d21322055c6bbd857a38c1505cd2 /ksysguard/ksysguardd/Linux/ProcessList.c
parentad771450f3fe9c170d8cef42147e444f2f7aaea8 (diff)
downloadtdebase-0598cdf67a4eab412e8e806fbdef4ec9f2769df3.tar.gz
tdebase-0598cdf67a4eab412e8e806fbdef4ec9f2769df3.zip
[ksysguardd] Use size_t for storing process memory usage.
Avoids the process memory usage rolling over at 4GiB on 64-bit systems. Signed-off-by: Daniel Collins <[email protected]> (cherry picked from commit f885561fda56d3b6eb47b1979a547b49a00954a2)
Diffstat (limited to 'ksysguard/ksysguardd/Linux/ProcessList.c')
-rw-r--r--ksysguard/ksysguardd/Linux/ProcessList.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ksysguard/ksysguardd/Linux/ProcessList.c b/ksysguard/ksysguardd/Linux/ProcessList.c
index 2708664bd..8582aae56 100644
--- a/ksysguard/ksysguardd/Linux/ProcessList.c
+++ b/ksysguard/ksysguardd/Linux/ProcessList.c
@@ -84,10 +84,10 @@ typedef struct {
The total amount of memory the process uses. This includes shared and
swapped memory.
*/
- unsigned int vmSize;
+ size_t vmSize;
/* The amount of physical memory the process currently uses. */
- unsigned int vmRss;
+ size_t vmRss;
/**
The number of 1/100 of a second the process has spend in user space.
@@ -215,7 +215,7 @@ static int updateProcess( int pid )
return -1;
if ( fscanf( fd, "%*d %*s %c %d %d %*d %d %*d %*u %*u %*u %*u %*u %d %d"
- "%*d %*d %*d %d %*u %*u %*d %u %u",
+ "%*d %*d %*d %d %*u %*u %*d %zu %zu",
&status, (int*)&ps->ppid, (int*)&ps->gid, &ps->ttyNo,
&userTime, &sysTime, &ps->niceLevel, &ps->vmSize,
&ps->vmRss) != 9 ) {
@@ -419,7 +419,7 @@ void printProcessList( const char* cmd )
(void)cmd;
for ( ps = first_ctnr( ProcessList ); ps; ps = next_ctnr( ProcessList ) ) {
- fprintf( CurrentClient, "%s\t%ld\t%ld\t%ld\t%ld\t%s\t%.2f\t%.2f\t%d\t%d\t%d"
+ fprintf( CurrentClient, "%s\t%ld\t%ld\t%ld\t%ld\t%s\t%.2f\t%.2f\t%d\t%zu\t%zu"
"\t%s\t%s\n", ps->name, (long)ps->pid, (long)ps->ppid,
(long)ps->uid, (long)ps->gid, ps->status, ps->userLoad,
ps->sysLoad, ps->niceLevel, ps->vmSize / 1024, ps->vmRss / 1024,