-static int cmp_comm(const char *, const char *);
-static int cmp_usrsys(const DBT *, const DBT *);
-static int cmp_avgusrsys(const DBT *, const DBT *);
-static int cmp_dkio(const DBT *, const DBT *);
-static int cmp_avgdkio(const DBT *, const DBT *);
-static int cmp_cpumem(const DBT *, const DBT *);
-static int cmp_avgcpumem(const DBT *, const DBT *);
-static int cmp_calls(const DBT *, const DBT *);
-static void usage(void);
+#endif
+static int cmp_comm(const char *, const char *);
+static int cmp_usrsys(const DBT *, const DBT *);
+static int cmp_avgusrsys(const DBT *, const DBT *);
+static int cmp_dkio(const DBT *, const DBT *);
+static int cmp_avgdkio(const DBT *, const DBT *);
+static int cmp_cpumem(const DBT *, const DBT *);
+static int cmp_avgcpumem(const DBT *, const DBT *);
+static int cmp_calls(const DBT *, const DBT *);
+static void usage(void);
int aflag, bflag, cflag, dflag, Dflag, fflag, iflag, jflag, kflag;
int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
u_quad_t cutoff = 1;
int aflag, bflag, cflag, dflag, Dflag, fflag, iflag, jflag, kflag;
int Kflag, lflag, mflag, qflag, rflag, sflag, tflag, uflag, vflag;
u_quad_t cutoff = 1;
/* for each file specified */
for (; argc > 0; argc--, argv++) {
/* for each file specified */
for (; argc > 0; argc--, argv++) {
/*
* load the accounting data from the file.
* if it fails, go on to the next file.
*/
/*
* load the accounting data from the file.
* if it fails, go on to the next file.
*/
* the saved stats; better to underbill than overbill,
* but we want every accounting record intact.
*/
* the saved stats; better to underbill than overbill,
* but we want every accounting record intact.
*/
if (rv == -1)
warn("error reading %s", pn);
else if (rv > 0 && rv < (int)sizeof(struct acct))
warnx("short read of accounting data in %s", pn);
if (rv != sizeof(struct acct))
break;
if (rv == -1)
warn("error reading %s", pn);
else if (rv > 0 && rv < (int)sizeof(struct acct))
warnx("short read of accounting data in %s", pn);
if (rv != sizeof(struct acct))
break;
+#else
+ if (ac.ac_flagx & AFORK)
+ ci.ci_comm[i++] = '*';
+ ci.ci_comm[i++] = '\0';
+ ci.ci_etime = ac.ac_etime;
+ ci.ci_utime = ac.ac_utime;
+ ci.ci_stime = ac.ac_stime;
+ ci.ci_uid = ac.ac_uid;
+ ci.ci_mem = ac.ac_mem;
+ ci.ci_io = ac.ac_io;
+#endif
ci.ci_uid,
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
(uintmax_t)ci.ci_mem, (uintmax_t)ci.ci_io,
ci.ci_comm);
ci.ci_uid,
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
(uintmax_t)ci.ci_mem, (uintmax_t)ci.ci_io,
ci.ci_comm);
memcpy(&c1, d1->data, sizeof(c1));
memcpy(&c2, d2->data, sizeof(c2));
memcpy(&c1, d1->data, sizeof(c1));
memcpy(&c2, d2->data, sizeof(c2));
memcpy(&c1, d1->data, sizeof(c1));
memcpy(&c2, d2->data, sizeof(c2));
memcpy(&c1, d1->data, sizeof(c1));
memcpy(&c2, d2->data, sizeof(c2));
n1 = (double) c1.ci_io / (double) (c1.ci_calls ? c1.ci_calls : 1);
n2 = (double) c2.ci_io / (double) (c2.ci_calls ? c2.ci_calls : 1);
n1 = (double) c1.ci_io / (double) (c1.ci_calls ? c1.ci_calls : 1);
n2 = (double) c2.ci_io / (double) (c2.ci_calls ? c2.ci_calls : 1);