summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkstailey <kstailey@openbsd.org>1997-11-06 15:59:49 +0000
committerkstailey <kstailey@openbsd.org>1997-11-06 15:59:49 +0000
commitfc8192a436ba0b32dabf4fc6600bac2712e211f4 (patch)
treee8874db1d0f1f22e3620c7700d71587a2cb5f9ab
parentAdd some missing things for the MI vga driver. Move wscons to an MI place as (diff)
downloadwireguard-openbsd-fc8192a436ba0b32dabf4fc6600bac2712e211f4.tar.xz
wireguard-openbsd-fc8192a436ba0b32dabf4fc6600bac2712e211f4.zip
fix ps(1) LIM column
-rw-r--r--bin/ps/keyword.c6
-rw-r--r--bin/ps/print.c12
-rw-r--r--sys/kern/kern_sysctl.c4
-rw-r--r--sys/sys/sysctl.h4
4 files changed, 15 insertions, 11 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 485c776d65d..4862272fe20 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.11 1997/09/03 13:51:40 kstailey Exp $ */
+/* $OpenBSD: keyword.c,v 1.12 1997/11/06 15:59:54 kstailey Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: keyword.c,v 1.11 1997/09/03 13:51:40 kstailey Exp $";
+static char rcsid[] = "$OpenBSD: keyword.c,v 1.12 1997/11/06 15:59:54 kstailey Exp $";
#endif
#endif /* not lint */
@@ -152,7 +152,7 @@ VAR var[] = {
/* XXX */
{"rgroup", "RGROUP", NULL, LJUST, rgname, USERLEN},
{"rlink", "RLINK", NULL, 0, pvar, 8, 0, POFF(p_back), KPTR, "x"},
- {"rss", "RSS", NULL, 0, p_rssize, 4},
+ {"rss", "RSS", NULL, 0, p_rssize, 5},
{"rssize", "", "rsz"},
{"rsz", "RSZ", NULL, 0, rssize, 4},
UID("ruid", "RUID", evar, EOFF(e_pcred.p_ruid)),
diff --git a/bin/ps/print.c b/bin/ps/print.c
index d420501b4d2..17c4b044012 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.11 1997/11/05 18:22:56 deraadt Exp $ */
+/* $OpenBSD: print.c,v 1.12 1997/11/06 15:59:56 kstailey Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.11 1997/11/05 18:22:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.12 1997/11/06 15:59:56 kstailey Exp $";
#endif
#endif /* not lint */
@@ -180,6 +180,8 @@ logname(k, ve)
(void)printf("%-*s", v->width, "-");
}
+#define pgtok(a) (((a)*getpagesize())/1024)
+
void
state(k, ve)
KINFO *k;
@@ -237,6 +239,8 @@ state(k, ve)
*cp++ = 'V';
if ((flag & P_SYSTEM) || p->p_holdcnt)
*cp++ = 'L';
+ if (KI_EPROC(k)->e_maxrss / 1024 < pgtok(KI_EPROC(k)->e_vm.vm_rssize))
+ *cp++ = '>';
if (KI_EPROC(k)->e_flag & EPROC_SLEADER)
*cp++ = 's';
if ((flag & P_CONTROLT) && KI_EPROC(k)->e_pgid == KI_EPROC(k)->e_tpgid)
@@ -435,8 +439,6 @@ wchan(k, ve)
(void)printf("%-*s", v->width, "-");
}
-#define pgtok(a) (((a)*getpagesize())/1024)
-
void
vsize(k, ve)
KINFO *k;
@@ -605,7 +607,7 @@ maxrss(k, ve)
VAR *v;
v = ve->var;
- (void)printf("%*s", v->width, "-");
+ (void)printf("%*d", v->width, KI_EPROC(k)->e_maxrss / 1024);
}
void
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 710f43f4ad8..5035cd21a18 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.22 1997/11/06 05:58:19 csapuntz Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.23 1997/11/06 15:59:49 kstailey Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -48,6 +48,7 @@
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/proc.h>
+#include <sys/resourcevar.h>
#include <sys/file.h>
#include <sys/vnode.h>
#include <sys/unistd.h>
@@ -754,4 +755,5 @@ fill_eproc(p, ep)
ep->e_login[MAXLOGNAME-1] = '\0';
strncpy(ep->e_emul, p->p_emul->e_name, EMULNAMELEN);
ep->e_emul[EMULNAMELEN] = '\0';
+ ep->e_maxrss = p->p_rlimit[RLIMIT_RSS].rlim_cur;
}
diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 07d0e6e27b1..efe262ea250 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.h,v 1.21 1997/11/06 05:59:11 csapuntz Exp $ */
+/* $OpenBSD: sysctl.h,v 1.22 1997/11/06 15:59:52 kstailey Exp $ */
/* $NetBSD: sysctl.h,v 1.16 1996/04/09 20:55:36 cgd Exp $ */
/*
@@ -222,7 +222,7 @@ struct kinfo_proc {
char e_login[MAXLOGNAME]; /* setlogin() name */
#define EMULNAMELEN 7
char e_emul[EMULNAMELEN+1]; /* syscall emulation name */
- u_int32_t e_spare[2]; /* XXX remove prior to release */
+ rlim_t e_maxrss;
} kp_eproc;
};