diff options
Diffstat (limited to 'bin')
-rw-r--r-- | bin/ps/extern.h | 64 | ||||
-rw-r--r-- | bin/ps/keyword.c | 6 | ||||
-rw-r--r-- | bin/ps/print.c | 68 | ||||
-rw-r--r-- | bin/ps/ps.c | 10 | ||||
-rw-r--r-- | bin/ps/ps.h | 6 |
5 files changed, 77 insertions, 77 deletions
diff --git a/bin/ps/extern.h b/bin/ps/extern.h index 61526d2b9ea..54561d24813 100644 --- a/bin/ps/extern.h +++ b/bin/ps/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.13 2006/05/02 05:25:19 hugh Exp $ */ +/* $OpenBSD: extern.h,v 1.14 2011/04/10 03:20:58 guenther Exp $ */ /* $NetBSD: extern.h,v 1.10 1995/05/21 13:38:27 mycroft Exp $ */ /*- @@ -44,42 +44,42 @@ extern VAR var[]; extern VARENT *vhead; __BEGIN_DECLS -void command(const struct kinfo_proc2 *, VARENT *); -void cputime(const struct kinfo_proc2 *, VARENT *); +void command(const struct kinfo_proc *, VARENT *); +void cputime(const struct kinfo_proc *, VARENT *); int donlist(void); -void emulname(const struct kinfo_proc2 *, VARENT *); +void emulname(const struct kinfo_proc *, VARENT *); void fmt_puts(const char *, int *); void fmt_putc(int, int *); -double getpcpu(const struct kinfo_proc2 *); -double getpmem(const struct kinfo_proc2 *); -void gname(const struct kinfo_proc2 *, VARENT *); -void logname(const struct kinfo_proc2 *, VARENT *); -void longtname(const struct kinfo_proc2 *, VARENT *); -void lstarted(const struct kinfo_proc2 *, VARENT *); -void maxrss(const struct kinfo_proc2 *, VARENT *); +double getpcpu(const struct kinfo_proc *); +double getpmem(const struct kinfo_proc *); +void gname(const struct kinfo_proc *, VARENT *); +void logname(const struct kinfo_proc *, VARENT *); +void longtname(const struct kinfo_proc *, VARENT *); +void lstarted(const struct kinfo_proc *, VARENT *); +void maxrss(const struct kinfo_proc *, VARENT *); void nlisterr(struct nlist *); -void p_rssize(const struct kinfo_proc2 *, VARENT *); -void pagein(const struct kinfo_proc2 *, VARENT *); +void p_rssize(const struct kinfo_proc *, VARENT *); +void pagein(const struct kinfo_proc *, VARENT *); void parsefmt(char *); -void pcpu(const struct kinfo_proc2 *, VARENT *); -void pmem(const struct kinfo_proc2 *, VARENT *); -void pri(const struct kinfo_proc2 *, VARENT *); +void pcpu(const struct kinfo_proc *, VARENT *); +void pmem(const struct kinfo_proc *, VARENT *); +void pri(const struct kinfo_proc *, VARENT *); void printheader(void); -void pvar(const struct kinfo_proc2 *kp, VARENT *); -void pnice(const struct kinfo_proc2 *kp, VARENT *); -void rgname(const struct kinfo_proc2 *, VARENT *); -void rssize(const struct kinfo_proc2 *, VARENT *); -void runame(const struct kinfo_proc2 *, VARENT *); +void pvar(const struct kinfo_proc *kp, VARENT *); +void pnice(const struct kinfo_proc *kp, VARENT *); +void rgname(const struct kinfo_proc *, VARENT *); +void rssize(const struct kinfo_proc *, VARENT *); +void runame(const struct kinfo_proc *, VARENT *); void showkey(void); -void started(const struct kinfo_proc2 *, VARENT *); -void state(const struct kinfo_proc2 *, VARENT *); -void tdev(const struct kinfo_proc2 *, VARENT *); -void tname(const struct kinfo_proc2 *, VARENT *); -void tsize(const struct kinfo_proc2 *, VARENT *); -void dsize(const struct kinfo_proc2 *, VARENT *); -void ssize(const struct kinfo_proc2 *, VARENT *); -void ucomm(const struct kinfo_proc2 *, VARENT *); -void euname(const struct kinfo_proc2 *, VARENT *); -void vsize(const struct kinfo_proc2 *, VARENT *); -void wchan(const struct kinfo_proc2 *, VARENT *); +void started(const struct kinfo_proc *, VARENT *); +void state(const struct kinfo_proc *, VARENT *); +void tdev(const struct kinfo_proc *, VARENT *); +void tname(const struct kinfo_proc *, VARENT *); +void tsize(const struct kinfo_proc *, VARENT *); +void dsize(const struct kinfo_proc *, VARENT *); +void ssize(const struct kinfo_proc *, VARENT *); +void ucomm(const struct kinfo_proc *, VARENT *); +void euname(const struct kinfo_proc *, VARENT *); +void vsize(const struct kinfo_proc *, VARENT *); +void wchan(const struct kinfo_proc *, VARENT *); __END_DECLS diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c index 6e98d750cb5..0b105b717e2 100644 --- a/bin/ps/keyword.c +++ b/bin/ps/keyword.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keyword.c,v 1.31 2011/03/12 04:54:28 guenther Exp $ */ +/* $OpenBSD: keyword.c,v 1.32 2011/04/10 03:20:58 guenther Exp $ */ /* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */ /*- @@ -60,7 +60,7 @@ int utime(), stime(), ixrss(), idrss(), isrss(); #endif /* Compute offset in common structures. */ -#define POFF(x) offsetof(struct kinfo_proc2, x) +#define POFF(x) offsetof(struct kinfo_proc, x) #define UIDFMT "u" #define UIDLEN 5 @@ -75,7 +75,7 @@ int utime(), stime(), ixrss(), idrss(), isrss(); #define USERLEN 8 -/* Bit types must match their respective entries in struct kinfo_proc2 */ +/* Bit types must match their respective entries in struct kinfo_proc */ VAR var[] = { {"%cpu", "%CPU", NULL, NLIST, pcpu, 4}, {"%mem", "%MEM", NULL, NLIST, pmem, 4}, diff --git a/bin/ps/print.c b/bin/ps/print.c index 4a5c62267cd..a4b116f9f05 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.47 2011/03/12 04:54:28 guenther Exp $ */ +/* $OpenBSD: print.c,v 1.48 2011/04/10 03:20:58 guenther Exp $ */ /* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */ /*- @@ -92,7 +92,7 @@ printheader(void) } void -command(const struct kinfo_proc2 *kp, VARENT *ve) +command(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; int left, wantspace = 0; @@ -109,7 +109,7 @@ command(const struct kinfo_proc2 *kp, VARENT *ve) } else left = -1; if (needenv && kd != NULL) { - argv = kvm_getenvv2(kd, kp, termwidth); + argv = kvm_getenvv(kd, kp, termwidth); if ((p = argv) != NULL) { while (*p) { fmt_puts(*p, &left); @@ -125,7 +125,7 @@ command(const struct kinfo_proc2 *kp, VARENT *ve) if (needcomm) { if (!commandonly) { if (kd != NULL) { - argv = kvm_getargv2(kd, kp, termwidth); + argv = kvm_getargv(kd, kp, termwidth); if ((p = argv) != NULL) { if (wantspace) { fmt_putc(' ', &left); @@ -169,7 +169,7 @@ command(const struct kinfo_proc2 *kp, VARENT *ve) } void -ucomm(const struct kinfo_proc2 *kp, VARENT *ve) +ucomm(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -178,7 +178,7 @@ ucomm(const struct kinfo_proc2 *kp, VARENT *ve) } void -logname(const struct kinfo_proc2 *kp, VARENT *ve) +logname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -195,7 +195,7 @@ logname(const struct kinfo_proc2 *kp, VARENT *ve) #define pgtok(a) (((unsigned long long)(a)*getpagesize())/1024) void -state(const struct kinfo_proc2 *kp, VARENT *ve) +state(const struct kinfo_proc *kp, VARENT *ve) { extern int ncpu; int flag; @@ -271,7 +271,7 @@ state(const struct kinfo_proc2 *kp, VARENT *ve) } void -pri(const struct kinfo_proc2 *kp, VARENT *ve) +pri(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -280,7 +280,7 @@ pri(const struct kinfo_proc2 *kp, VARENT *ve) } void -pnice(const struct kinfo_proc2 *kp, VARENT *ve) +pnice(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; v = ve->var; @@ -288,7 +288,7 @@ pnice(const struct kinfo_proc2 *kp, VARENT *ve) } void -euname(const struct kinfo_proc2 *kp, VARENT *ve) +euname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -298,7 +298,7 @@ euname(const struct kinfo_proc2 *kp, VARENT *ve) } void -runame(const struct kinfo_proc2 *kp, VARENT *ve) +runame(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -308,7 +308,7 @@ runame(const struct kinfo_proc2 *kp, VARENT *ve) } void -gname(const struct kinfo_proc2 *kp, VARENT *ve) +gname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -318,7 +318,7 @@ gname(const struct kinfo_proc2 *kp, VARENT *ve) } void -rgname(const struct kinfo_proc2 *kp, VARENT *ve) +rgname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -328,7 +328,7 @@ rgname(const struct kinfo_proc2 *kp, VARENT *ve) } void -tdev(const struct kinfo_proc2 *kp, VARENT *ve) +tdev(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; dev_t dev; @@ -346,7 +346,7 @@ tdev(const struct kinfo_proc2 *kp, VARENT *ve) } void -tname(const struct kinfo_proc2 *kp, VARENT *ve) +tname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; dev_t dev; @@ -365,7 +365,7 @@ tname(const struct kinfo_proc2 *kp, VARENT *ve) } void -longtname(const struct kinfo_proc2 *kp, VARENT *ve) +longtname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; dev_t dev; @@ -380,7 +380,7 @@ longtname(const struct kinfo_proc2 *kp, VARENT *ve) } void -started(const struct kinfo_proc2 *kp, VARENT *ve) +started(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; static time_t now; @@ -408,7 +408,7 @@ started(const struct kinfo_proc2 *kp, VARENT *ve) } void -lstarted(const struct kinfo_proc2 *kp, VARENT *ve) +lstarted(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; time_t startt; @@ -426,7 +426,7 @@ lstarted(const struct kinfo_proc2 *kp, VARENT *ve) } void -wchan(const struct kinfo_proc2 *kp, VARENT *ve) +wchan(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -438,7 +438,7 @@ wchan(const struct kinfo_proc2 *kp, VARENT *ve) } void -vsize(const struct kinfo_proc2 *kp, VARENT *ve) +vsize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -448,7 +448,7 @@ vsize(const struct kinfo_proc2 *kp, VARENT *ve) } void -rssize(const struct kinfo_proc2 *kp, VARENT *ve) +rssize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -459,7 +459,7 @@ rssize(const struct kinfo_proc2 *kp, VARENT *ve) } void -p_rssize(const struct kinfo_proc2 *kp, VARENT *ve) +p_rssize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -469,7 +469,7 @@ p_rssize(const struct kinfo_proc2 *kp, VARENT *ve) } void -cputime(const struct kinfo_proc2 *kp, VARENT *ve) +cputime(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; long secs; @@ -505,7 +505,7 @@ cputime(const struct kinfo_proc2 *kp, VARENT *ve) } double -getpcpu(const struct kinfo_proc2 *kp) +getpcpu(const struct kinfo_proc *kp) { double d; @@ -532,7 +532,7 @@ getpcpu(const struct kinfo_proc2 *kp) } void -pcpu(const struct kinfo_proc2 *kp, VARENT *ve) +pcpu(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -541,7 +541,7 @@ pcpu(const struct kinfo_proc2 *kp, VARENT *ve) } double -getpmem(const struct kinfo_proc2 *kp) +getpmem(const struct kinfo_proc *kp) { double fracmem; int szptudot; @@ -559,7 +559,7 @@ getpmem(const struct kinfo_proc2 *kp) } void -pmem(const struct kinfo_proc2 *kp, VARENT *ve) +pmem(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -568,7 +568,7 @@ pmem(const struct kinfo_proc2 *kp, VARENT *ve) } void -pagein(const struct kinfo_proc2 *kp, VARENT *ve) +pagein(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -578,7 +578,7 @@ pagein(const struct kinfo_proc2 *kp, VARENT *ve) } void -maxrss(const struct kinfo_proc2 *kp, VARENT *ve) +maxrss(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -587,7 +587,7 @@ maxrss(const struct kinfo_proc2 *kp, VARENT *ve) } void -tsize(const struct kinfo_proc2 *kp, VARENT *ve) +tsize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -596,7 +596,7 @@ tsize(const struct kinfo_proc2 *kp, VARENT *ve) } void -dsize(const struct kinfo_proc2 *kp, VARENT *ve) +dsize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -605,7 +605,7 @@ dsize(const struct kinfo_proc2 *kp, VARENT *ve) } void -ssize(const struct kinfo_proc2 *kp, VARENT *ve) +ssize(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -665,7 +665,7 @@ printval(char *bp, VAR *v) } void -pvar(const struct kinfo_proc2 *kp, VARENT *ve) +pvar(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; @@ -677,7 +677,7 @@ pvar(const struct kinfo_proc2 *kp, VARENT *ve) } void -emulname(const struct kinfo_proc2 *kp, VARENT *ve) +emulname(const struct kinfo_proc *kp, VARENT *ve) { VAR *v; diff --git a/bin/ps/ps.c b/bin/ps/ps.c index c5fd549841d..96511ee42fd 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ps.c,v 1.48 2010/07/02 15:43:15 guenther Exp $ */ +/* $OpenBSD: ps.c,v 1.49 2011/04/10 03:20:58 guenther Exp $ */ /* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */ /*- @@ -91,7 +91,7 @@ int kvm_sysctl_only; int main(int argc, char *argv[]) { - struct kinfo_proc2 *kp, **kinfo; + struct kinfo_proc *kp, **kinfo; struct varent *vent; struct winsize ws; struct passwd *pwd; @@ -313,7 +313,7 @@ main(int argc, char *argv[]) /* * select procs */ - kp = kvm_getproc2(kd, what, flag, sizeof(*kp), &nentries); + kp = kvm_getprocs(kd, what, flag, sizeof(*kp), &nentries); if (kp == NULL) errx(1, "%s", kvm_geterr(kd)); @@ -378,8 +378,8 @@ scanvars(void) static int pscomp(const void *v1, const void *v2) { - const struct kinfo_proc2 *kp1 = *(const struct kinfo_proc2 **)v1; - const struct kinfo_proc2 *kp2 = *(const struct kinfo_proc2 **)v2; + const struct kinfo_proc *kp1 = *(const struct kinfo_proc **)v1; + const struct kinfo_proc *kp2 = *(const struct kinfo_proc **)v2; int i; #define VSIZE(k) ((k)->p_vm_dsize + (k)->p_vm_ssize + (k)->p_vm_tsize) diff --git a/bin/ps/ps.h b/bin/ps/ps.h index 094444e3d6e..2c2b59305c1 100644 --- a/bin/ps/ps.h +++ b/bin/ps/ps.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ps.h,v 1.8 2008/03/08 19:20:12 millert Exp $ */ +/* $OpenBSD: ps.h,v 1.9 2011/04/10 03:20:58 guenther Exp $ */ /* $NetBSD: ps.h,v 1.11 1995/09/29 21:57:03 cgd Exp $ */ /*- @@ -51,7 +51,7 @@ typedef struct varent { struct var *var; } VARENT; -struct kinfo_proc2; +struct kinfo_proc; typedef struct var { char *name; /* name(s) of variable */ char *header; /* default header */ @@ -63,7 +63,7 @@ typedef struct var { #define NLIST 0x10 /* needs nlist info from kernel */ u_int flag; /* output routine */ - void (*oproc)(const struct kinfo_proc2 *, struct varent *); + void (*oproc)(const struct kinfo_proc *, struct varent *); short width; /* printing width */ char parsed; /* have we been parsed yet? (avoid dupes) */ /* |