summaryrefslogtreecommitdiff
path: root/bin/ps
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 23:42:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-11 23:42:13 +0000
commitb7e43e8440a0d47510d40dd5d9440dccf52a05f2 (patch)
tree20886296c48f50f9e7f28003e17761fd8acd14e0 /bin/ps
parenta760a3046bfab4c3721cea25480d9f998d1cf0e8 (diff)
ansification, art ok
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/keyword.c15
-rw-r--r--bin/ps/nlist.c12
-rw-r--r--bin/ps/print.c143
-rw-r--r--bin/ps/ps.c21
4 files changed, 57 insertions, 134 deletions
diff --git a/bin/ps/keyword.c b/bin/ps/keyword.c
index 5f4e1879a9e..882d3af1d1f 100644
--- a/bin/ps/keyword.c
+++ b/bin/ps/keyword.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: keyword.c,v 1.17 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: keyword.c,v 1.18 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: keyword.c,v 1.12.6.1 1996/05/30 21:25:13 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: keyword.c,v 1.17 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: keyword.c,v 1.18 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -187,7 +187,7 @@ VAR var[] = {
};
void
-showkey()
+showkey(void)
{
VAR *v;
int i;
@@ -208,8 +208,7 @@ showkey()
}
void
-parsefmt(p)
- char *p;
+parsefmt(char *p)
{
static struct varent *vtail;
@@ -242,8 +241,7 @@ parsefmt(p)
}
static VAR *
-findvar(p)
- char *p;
+findvar(char *p)
{
VAR *v, key;
char *hp;
@@ -277,8 +275,7 @@ findvar(p)
}
static int
-vcmp(a, b)
- const void *a, *b;
+vcmp(const void *a, const void *b)
{
return (strcmp(((VAR *)a)->name, ((VAR *)b)->name));
}
diff --git a/bin/ps/nlist.c b/bin/ps/nlist.c
index 8a93777a9e5..342bd4b046b 100644
--- a/bin/ps/nlist.c
+++ b/bin/ps/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.13 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: nlist.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: nlist.c,v 1.11 1995/03/21 09:08:03 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)nlist.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: nlist.c,v 1.13 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: nlist.c,v 1.14 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -79,7 +79,7 @@ extern int kvm_sysctl_only;
kvm_read(kd, psnl[x].n_value, &v, sizeof v) != sizeof(v)
int
-donlist()
+donlist(void)
{
int rval, mib[2];
size_t siz;
@@ -109,8 +109,7 @@ donlist()
warnx("maxslp: %s", kvm_geterr(kd));
eval = rval = 1;
}
- }
- else {
+ } else {
siz = sizeof (fscale);
mib[0] = CTL_KERN;
mib[1] = KERN_FSCALE;
@@ -145,8 +144,7 @@ donlist()
}
void
-nlisterr(nl)
- struct nlist nl[];
+nlisterr(struct nlist nl[])
{
int i;
diff --git a/bin/ps/print.c b/bin/ps/print.c
index 69387be61fd..a6cbd76acb5 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.30 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: print.c,v 1.31 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: print.c,v 1.27 1995/09/29 21:58:12 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.30 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.31 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -71,8 +71,7 @@ static char *cmdpart(char *);
#define min(a,b) ((a) < (b) ? (a) : (b))
static char *
-cmdpart(arg0)
- char *arg0;
+cmdpart(char *arg0)
{
char *cp;
@@ -80,7 +79,7 @@ cmdpart(arg0)
}
void
-printheader()
+printheader(void)
{
VAR *v;
struct varent *vent;
@@ -101,9 +100,7 @@ printheader()
}
void
-command(ki, ve)
- KINFO *ki;
- VARENT *ve;
+command(KINFO *ki, VARENT *ve)
{
VAR *v;
int left;
@@ -157,9 +154,7 @@ command(ki, ve)
}
void
-ucomm(k, ve)
- KINFO *k;
- VARENT *ve;
+ucomm(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -168,9 +163,7 @@ ucomm(k, ve)
}
void
-logname(k, ve)
- KINFO *k;
- VARENT *ve;
+logname(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -187,9 +180,7 @@ logname(k, ve)
#define pgtok(a) (((a)*getpagesize())/1024)
void
-state(k, ve)
- KINFO *k;
- VARENT *ve;
+state(KINFO *k, VARENT *ve)
{
struct proc *p;
int flag;
@@ -260,9 +251,7 @@ state(k, ve)
}
void
-pri(k, ve)
- KINFO *k;
- VARENT *ve;
+pri(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -271,9 +260,7 @@ pri(k, ve)
}
void
-uname(k, ve)
- KINFO *k;
- VARENT *ve;
+uname(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -283,9 +270,7 @@ uname(k, ve)
}
void
-runame(k, ve)
- KINFO *k;
- VARENT *ve;
+runame(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -295,9 +280,7 @@ runame(k, ve)
}
void
-gname(k, ve)
- KINFO *k;
- VARENT *ve;
+gname(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -307,9 +290,7 @@ gname(k, ve)
}
void
-rgname(k, ve)
- KINFO *k;
- VARENT *ve;
+rgname(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -319,9 +300,7 @@ rgname(k, ve)
}
void
-tdev(k, ve)
- KINFO *k;
- VARENT *ve;
+tdev(KINFO *k, VARENT *ve)
{
VAR *v;
dev_t dev;
@@ -339,9 +318,7 @@ tdev(k, ve)
}
void
-tname(k, ve)
- KINFO *k;
- VARENT *ve;
+tname(KINFO *k, VARENT *ve)
{
VAR *v;
dev_t dev;
@@ -360,9 +337,7 @@ tname(k, ve)
}
void
-longtname(k, ve)
- KINFO *k;
- VARENT *ve;
+longtname(KINFO *k, VARENT *ve)
{
VAR *v;
dev_t dev;
@@ -377,9 +352,7 @@ longtname(k, ve)
}
void
-started(k, ve)
- KINFO *k;
- VARENT *ve;
+started(KINFO *k, VARENT *ve)
{
VAR *v;
static time_t now;
@@ -407,9 +380,7 @@ started(k, ve)
}
void
-lstarted(k, ve)
- KINFO *k;
- VARENT *ve;
+lstarted(KINFO *k, VARENT *ve)
{
VAR *v;
time_t startt;
@@ -427,9 +398,7 @@ lstarted(k, ve)
}
void
-wchan(k, ve)
- KINFO *k;
- VARENT *ve;
+wchan(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -450,9 +419,7 @@ wchan(k, ve)
}
void
-vsize(k, ve)
- KINFO *k;
- VARENT *ve;
+vsize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -463,9 +430,7 @@ vsize(k, ve)
}
void
-rssize(k, ve)
- KINFO *k;
- VARENT *ve;
+rssize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -476,9 +441,7 @@ rssize(k, ve)
}
void
-p_rssize(k, ve) /* doesn't account for text */
- KINFO *k;
- VARENT *ve;
+p_rssize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -488,9 +451,7 @@ p_rssize(k, ve) /* doesn't account for text */
}
void
-cputime(k, ve)
- KINFO *k;
- VARENT *ve;
+cputime(KINFO *k, VARENT *ve)
{
VAR *v;
long secs;
@@ -528,8 +489,7 @@ cputime(k, ve)
}
double
-getpcpu(k)
- KINFO *k;
+getpcpu(KINFO *k)
{
struct proc *p;
static int failure;
@@ -561,9 +521,7 @@ getpcpu(k)
}
void
-pcpu(k, ve)
- KINFO *k;
- VARENT *ve;
+pcpu(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -572,8 +530,7 @@ pcpu(k, ve)
}
double
-getpmem(k)
- KINFO *k;
+getpmem(KINFO *k)
{
static int failure;
struct proc *p;
@@ -598,9 +555,7 @@ getpmem(k)
}
void
-pmem(k, ve)
- KINFO *k;
- VARENT *ve;
+pmem(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -609,9 +564,7 @@ pmem(k, ve)
}
void
-pagein(k, ve)
- KINFO *k;
- VARENT *ve;
+pagein(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -621,9 +574,7 @@ pagein(k, ve)
}
void
-maxrss(k, ve)
- KINFO *k;
- VARENT *ve;
+maxrss(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -632,9 +583,7 @@ maxrss(k, ve)
}
void
-tsize(k, ve)
- KINFO *k;
- VARENT *ve;
+tsize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -643,9 +592,7 @@ tsize(k, ve)
}
void
-dsize(k, ve)
- KINFO *k;
- VARENT *ve;
+dsize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -654,9 +601,7 @@ dsize(k, ve)
}
void
-ssize(k, ve)
- KINFO *k;
- VARENT *ve;
+ssize(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -669,9 +614,7 @@ ssize(k, ve)
* structures.
*/
static void
-printval(bp, v)
- char *bp;
- VAR *v;
+printval(char *bp, VAR *v)
{
static char ofmt[32] = "%";
char *fcp, *cp;
@@ -749,9 +692,7 @@ printval(bp, v)
}
void
-pvar(k, ve)
- KINFO *k;
- VARENT *ve;
+pvar(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -760,9 +701,7 @@ pvar(k, ve)
}
void
-evar(k, ve)
- KINFO *k;
- VARENT *ve;
+evar(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -771,9 +710,7 @@ evar(k, ve)
}
void
-uvar(k, ve)
- KINFO *k;
- VARENT *ve;
+uvar(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -785,9 +722,7 @@ uvar(k, ve)
}
void
-rvar(k, ve)
- KINFO *k;
- VARENT *ve;
+rvar(KINFO *k, VARENT *ve)
{
VAR *v;
@@ -799,9 +734,7 @@ rvar(k, ve)
}
void
-emulname(k, ve)
- KINFO *k;
- VARENT *ve;
+emulname(KINFO *k, VARENT *ve)
{
VAR *v;
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 2b986333766..e99fa1482a4 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ps.c,v 1.32 2003/06/02 23:32:09 millert Exp $ */
+/* $OpenBSD: ps.c,v 1.33 2003/06/11 23:42:12 deraadt Exp $ */
/* $NetBSD: ps.c,v 1.15 1995/05/18 20:33:25 mycroft Exp $ */
/*-
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: ps.c,v 1.32 2003/06/02 23:32:09 millert Exp $";
+static char rcsid[] = "$OpenBSD: ps.c,v 1.33 2003/06/11 23:42:12 deraadt Exp $";
#endif
#endif /* not lint */
@@ -103,9 +103,7 @@ kvm_t *kd;
int kvm_sysctl_only;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct kinfo_proc *kp;
struct varent *vent;
@@ -385,7 +383,7 @@ main(argc, argv)
}
static void
-scanvars()
+scanvars(void)
{
struct varent *vent;
VAR *v;
@@ -404,8 +402,7 @@ scanvars()
}
static void
-saveuser(ki)
- KINFO *ki;
+saveuser(KINFO *ki)
{
struct usave *usp;
@@ -419,8 +416,7 @@ saveuser(ki)
}
static int
-pscomp(a, b)
- const void *a, *b;
+pscomp(const void *a, const void *b)
{
int i;
#define VSIZE(k) (KI_EPROC(k)->e_vm.vm_dsize + KI_EPROC(k)->e_vm.vm_ssize + \
@@ -452,8 +448,7 @@ pscomp(a, b)
* feature is available with the option 'T', which takes no argument.
*/
static char *
-kludge_oldps_options(s)
- char *s;
+kludge_oldps_options(char *s)
{
size_t len;
char *newopts, *ns, *cp;
@@ -503,7 +498,7 @@ kludge_oldps_options(s)
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: %s [-][acCehjklmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]\n",