+ goto garbage;
+}
+
+prcom(a)
+ register struct psout *a;
+{
+ long tm;
+
+ if (rflg) {
+ write(1, a, sizeof (*a));
+ return(0);
+ }
+ if (lflg) {
+ printf("%4x %c", 0xffff & a->o_flag,
+ "0SWRIZT"[a->o_stat]);
+ printf("%4d", a->o_uid);
+ } else if (vflg) {
+ switch (a->o_stat) {
+
+ case SSLEEP:
+ case SSTOP:
+ if ((a->o_flag & SLOAD) == 0)
+ printf("W");
+ else if (a->o_pri >= PZERO)
+ printf("S");
+ else if (a->o_flag & SPAGE)
+ printf("P");
+ else
+ printf("D");
+ break;
+
+ case SRUN:
+ case SIDL:
+ if (a->o_flag & SLOAD)
+ printf("R");
+ else
+ printf("W");
+ break;
+ }
+ if (a->o_nice > NZERO)
+ printf("N");
+ else
+ printf(" ");
+ } else if (uflg) {
+ printf("%-8.8s", a->o_uname);
+ }
+ if (sflg) {
+ printf("%5d", a->o_stksize);
+ }
+ printf("%6u", a->o_pid);
+ if (lflg)
+ printf("%6u%4d%4d%4d%6x", a->o_ppid, a->o_cpu&0377,
+ a->o_pri, a->o_nice, a->o_addr0);
+ else if (uflg)
+ printf("%5.1f%4d ", a->o_pctcpu, a->o_nice);
+ if (lflg || uflg)
+ printf("%4d%5d", a->o_dsize+a->o_ssize, a->o_rssize);
+ if (lflg)
+ if (a->o_wchan)
+ printf("%6x", clear(a->o_wchan));
+ else
+ printf(" ");
+ printf(" %-2.2s", a->o_tty);
+ if (a->o_stat==SZOMB) {
+ printf(" <defunct>");
+ return(1);
+ }
+ tm = (a->o_utime + a->o_stime + 30)/60;
+ printf("%3ld:", tm/60);
+ tm %= 60;
+ printf(tm<10?"0%ld":"%ld", tm);
+ if (vflg) {
+/*
+ tm = (a->o_stime + 30) / 60;
+ printf(" %2ld:", tm/60);
+ tm %= 60;
+ printf(tm<10?"0%ld":"%ld", tm);
+*/
+ printf("%4d%3d", a->o_time, a->o_slptime);
+ }
+#ifdef notdef
+ if (0 && lflg==0) { /* 0 == old tflg (print long times) */
+ tm = (a->o_cstime + 30)/60;
+ printf(" %2ld:", tm/60);
+ tm %= 60;
+ printf(tm<10?"0%ld":"%ld", tm);
+ tm = (a->o_cutime + 30)/60;
+ printf(" %2ld:", tm/60);
+ tm %= 60;
+ printf(tm<10?"0%ld":"%ld", tm);
+ }
+#endif
+ if (vflg) {
+ printf("%7d%7d",a->o_minorflt,a->o_majorflt);
+ printf("%5d%4d%4d", a->o_dsize+a->o_ssize, a->o_rssize, a->o_swrss);
+ printf("%5d%4d", a->o_xsize, a->o_xrssize);
+ printf("%3d", a->o_aveflt);
+ }
+ if (a->o_pid == 0) {
+ printf(" swapper");
+ return(1);
+ }
+ if (a->o_pid == 2) {
+ printf(" pagedaemon");
+ return(1);
+ }
+ if (cflg) {
+ printf(" %s", a->o_comm);
+ return(1);
+ }
+ a -> o_args[argwidth] = 0; /* force it to quit early */
+ printf(" %s", a->o_args);
+ return (1);