diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2004-02-08 11:50:27 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2004-02-08 11:50:27 +0800 |
commit | 80e94d32f4ab7900ec7fb9bdadacbb245de64233 (patch) | |
tree | d06d08bcbc9fcd93b0804b32a0e66cdc1573f907 | |
parent | 1b9a1adf20f68c0fd7d55543b27d7d71b91f3840 (diff) | |
download | marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar.gz marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar.bz2 marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar.lz marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar.xz marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.tar.zst marcuscom-ports-80e94d32f4ab7900ec7fb9bdadacbb245de64233.zip |
Switch from using struct plimit with a kvm_read to using getrlimit to retrieve
RLIMIT_RSS.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@1796 df743ca5-7f9a-e211-a948-0013205c9059
-rw-r--r-- | devel/libgtop2/files/patch-sysdeps::freebsd::procmem.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/devel/libgtop2/files/patch-sysdeps::freebsd::procmem.c b/devel/libgtop2/files/patch-sysdeps::freebsd::procmem.c index a174fda33..83e508054 100644 --- a/devel/libgtop2/files/patch-sysdeps::freebsd::procmem.c +++ b/devel/libgtop2/files/patch-sysdeps::freebsd::procmem.c @@ -1,9 +1,22 @@ ---- sysdeps/freebsd/procmem.c.orig Fri May 28 03:56:49 1999 -+++ sysdeps/freebsd/procmem.c Sun Sep 7 21:37:38 2003 -@@ -137,6 +137,23 @@ +--- sysdeps/freebsd/procmem.c.orig Sun Oct 19 12:55:32 2003 ++++ sysdeps/freebsd/procmem.c Sat Feb 7 22:48:12 2004 +@@ -117,7 +117,7 @@ + #else + struct vm_object object; + #endif +- struct plimit plimit; ++ struct rlimit rlimit; + int count; + + glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0); +@@ -137,15 +137,29 @@ return; } +- if (kvm_read (server->machine.kd, +- (unsigned long) pinfo [0].kp_proc.p_limit, +- (char *) &plimit, sizeof (plimit)) != sizeof (plimit)) { +- glibtop_warn_io_r (server, "kvm_read (plimit)"); +#if __FreeBSD_version >= 500013 + +#define XXX_P_VMSPACE ki_vmspace @@ -21,10 +34,18 @@ + +#define XXX_P_VMSPACE kp_proc.p_vmspace + - if (kvm_read (server->machine.kd, - (unsigned long) pinfo [0].kp_proc.p_limit, - (char *) &plimit, sizeof (plimit)) != sizeof (plimit)) { -@@ -154,11 +171,12 @@ ++ if (getrlimit (RLIMIT_RSS, &rlimit) < 0) { ++ glibtop_warn_io_r (server, "getrlimit"); + return; + } + +- buf->rss_rlim = (u_int64_t) +- (plimit.pl_rlimit [RLIMIT_RSS].rlim_cur); ++ buf->rss_rlim = (u_int64_t) (rlimit.rlim_cur); + + vms = &pinfo [0].kp_eproc.e_vm; + +@@ -154,11 +168,12 @@ buf->resident = buf->rss = (u_int64_t) pagetok (vms->vm_rssize) << LOG1024; |