Get rid of %qd, and unbreak Alpha build.
This commit is contained in:
parent
bdff575a42
commit
72d78aeaeb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100107
@ -49,6 +49,7 @@ static const char rcsid[] =
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -361,10 +362,11 @@ acct_load(pn, wr)
|
|||||||
if (sflag || (mflag && !qflag))
|
if (sflag || (mflag && !qflag))
|
||||||
usracct_add(&ci);
|
usracct_add(&ci);
|
||||||
} else if (!qflag)
|
} else if (!qflag)
|
||||||
printf("%6lu %12.2f cpu %12quk mem %12qu io %s\n",
|
printf("%6lu %12.2f cpu %12juk mem %12ju io %s\n",
|
||||||
ci.ci_uid,
|
ci.ci_uid,
|
||||||
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
|
(ci.ci_utime + ci.ci_stime) / (double) AHZ,
|
||||||
ci.ci_mem, ci.ci_io, ci.ci_comm);
|
(uintmax_t)ci.ci_mem, (uintmax_t)ci.ci_io,
|
||||||
|
ci.ci_comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* finally, return the file descriptor for possible truncation */
|
/* finally, return the file descriptor for possible truncation */
|
||||||
|
@ -38,6 +38,7 @@ static const char rcsid[] =
|
|||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
@ -309,7 +310,7 @@ check_junk(cip)
|
|||||||
char *cp;
|
char *cp;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
fprintf(stderr, "%s (%qu) -- ", cip->ci_comm, cip->ci_calls);
|
fprintf(stderr, "%s (%ju) -- ", cip->ci_comm, (uintmax_t)cip->ci_calls);
|
||||||
cp = fgetln(stdin, &len);
|
cp = fgetln(stdin, &len);
|
||||||
|
|
||||||
return (cp && (cp[0] == 'y' || cp[0] == 'Y')) ? 1 : 0;
|
return (cp && (cp[0] == 'y' || cp[0] == 'Y')) ? 1 : 0;
|
||||||
@ -343,7 +344,7 @@ print_ci(cip, totalcip)
|
|||||||
} else
|
} else
|
||||||
uflow = 0;
|
uflow = 0;
|
||||||
|
|
||||||
printf("%8qu ", cip->ci_calls);
|
printf("%8ju ", (uintmax_t)cip->ci_calls);
|
||||||
if (cflag) {
|
if (cflag) {
|
||||||
if (cip != totalcip)
|
if (cip != totalcip)
|
||||||
printf(" %4.2f%% ",
|
printf(" %4.2f%% ",
|
||||||
@ -410,12 +411,12 @@ print_ci(cip, totalcip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Dflag)
|
if (Dflag)
|
||||||
printf("%10qutio ", cip->ci_io);
|
printf("%10jutio ", (uintmax_t)cip->ci_io);
|
||||||
else
|
else
|
||||||
printf("%8.0favio ", cip->ci_io / c);
|
printf("%8.0favio ", cip->ci_io / c);
|
||||||
|
|
||||||
if (Kflag)
|
if (Kflag)
|
||||||
printf("%10quk*sec ", cip->ci_mem);
|
printf("%10juk*sec ", (uintmax_t)cip->ci_mem);
|
||||||
else
|
else
|
||||||
printf("%8.0fk ", cip->ci_mem / t);
|
printf("%8.0fk ", cip->ci_mem / t);
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ static const char rcsid[] =
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -238,8 +239,8 @@ usracct_print()
|
|||||||
while (rv == 0) {
|
while (rv == 0) {
|
||||||
memcpy(ui, data.data, sizeof(struct userinfo));
|
memcpy(ui, data.data, sizeof(struct userinfo));
|
||||||
|
|
||||||
printf("%-*s %9qu ", MAXLOGNAME - 1,
|
printf("%-*s %9ju ", MAXLOGNAME - 1,
|
||||||
user_from_uid(ui->ui_uid, 0), ui->ui_calls);
|
user_from_uid(ui->ui_uid, 0), (uintmax_t)ui->ui_calls);
|
||||||
|
|
||||||
t = (double) (ui->ui_utime + ui->ui_stime) /
|
t = (double) (ui->ui_utime + ui->ui_stime) /
|
||||||
(double) AHZ;
|
(double) AHZ;
|
||||||
@ -250,15 +251,16 @@ usracct_print()
|
|||||||
|
|
||||||
/* ui->ui_calls is always != 0 */
|
/* ui->ui_calls is always != 0 */
|
||||||
if (dflag)
|
if (dflag)
|
||||||
printf("%12qu%s", ui->ui_io / ui->ui_calls, "avio");
|
printf("%12ju%s",
|
||||||
|
(uintmax_t)(ui->ui_io / ui->ui_calls), "avio");
|
||||||
else
|
else
|
||||||
printf("%12qu%s", ui->ui_io, "tio");
|
printf("%12ju%s", (uintmax_t)ui->ui_io, "tio");
|
||||||
|
|
||||||
/* t is always >= 0.0001; see above */
|
/* t is always >= 0.0001; see above */
|
||||||
if (kflag)
|
if (kflag)
|
||||||
printf("%12.0f%s", ui->ui_mem / t, "k");
|
printf("%12.0f%s", ui->ui_mem / t, "k");
|
||||||
else
|
else
|
||||||
printf("%12qu%s", ui->ui_mem, "k*sec");
|
printf("%12ju%s", (uintmax_t)ui->ui_mem, "k*sec");
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user