From 217a1e92c60489d0ec1879ed487e165a532abd5f Mon Sep 17 00:00:00 2001 From: Drazen Kacar Date: Fri, 7 May 1999 20:38:13 +0000 Subject: [PATCH] Implemented size, vsize, resident and rss. * procmem.c: Implemented size, vsize, resident and rss. --- sysdeps/solaris/ChangeLog | 4 ++++ sysdeps/solaris/procmem.c | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/sysdeps/solaris/ChangeLog b/sysdeps/solaris/ChangeLog index 3217022b..7f57ed39 100644 --- a/sysdeps/solaris/ChangeLog +++ b/sysdeps/solaris/ChangeLog @@ -1,3 +1,7 @@ +1999-05-07 Drazen Kacar + + * procmem.c: Implemented size, vsize, resident and rss. + 1999-05-06 Drazen Kacar * siglist.c: Fixed, valid for Solaris 2.6 & 7. diff --git a/sysdeps/solaris/procmem.c b/sysdeps/solaris/procmem.c index ab0c4170..b44e9cca 100644 --- a/sysdeps/solaris/procmem.c +++ b/sysdeps/solaris/procmem.c @@ -24,7 +24,9 @@ #include #include -static const unsigned long _glibtop_sysdeps_proc_mem = 0; +static const unsigned long _glibtop_sysdeps_proc_mem = +(1L << GLIBTOP_PROC_MEM_SIZE) + (1L << GLIBTOP_PROC_MEM_VSIZE) + +(1L << GLIBTOP_PROC_MEM_RESIDENT) + (1L << GLIBTOP_PROC_MEM_RSS); /* Init function. */ @@ -40,5 +42,15 @@ void glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) { + struct psinfo psinfo; + memset (buf, 0, sizeof (glibtop_proc_mem)); + + if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid)) + return; + + buf->size = buf->vsize = psinfo.pr_size; + buf->resident = buf->rss = psinfo.pr_rssize; + + buf->flags = _glibtop_sysdeps_proc_mem; }