Deleted Added
full compact
main.c (99829) main.c (100107)
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31#ifndef lint
32static const char copyright[] =
33"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
34 All rights reserved.\n";
35#endif
36
37#ifndef lint
38static const char rcsid[] =
1/*
2 * Copyright (c) 1994 Christopher G. Demetriou
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31#ifndef lint
32static const char copyright[] =
33"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
34 All rights reserved.\n";
35#endif
36
37#ifndef lint
38static const char rcsid[] =
39 "$FreeBSD: head/usr.sbin/sa/main.c 99829 2002-07-11 22:11:20Z alfred $";
39 "$FreeBSD: head/usr.sbin/sa/main.c 100107 2002-07-15 16:05:15Z des $";
40#endif /* not lint */
41
42/*
43 * sa: system accounting
44 */
45
46#include <sys/types.h>
47#include <sys/acct.h>
48#include <ctype.h>
49#include <err.h>
50#include <fcntl.h>
51#include <signal.h>
40#endif /* not lint */
41
42/*
43 * sa: system accounting
44 */
45
46#include <sys/types.h>
47#include <sys/acct.h>
48#include <ctype.h>
49#include <err.h>
50#include <fcntl.h>
51#include <signal.h>
52#include <stdint.h>
52#include <stdio.h>
53#include <stdlib.h>
54#include <string.h>
55#include <unistd.h>
56#include "extern.h"
57#include "pathnames.h"
58
59static int acct_load(char *, int);

--- 296 unchanged lines hidden (view full) ---

356
357 if (!uflag) {
358 /* and enter it into the usracct and pacct databases */
359 if (sflag || (!mflag && !qflag))
360 pacct_add(&ci);
361 if (sflag || (mflag && !qflag))
362 usracct_add(&ci);
363 } else if (!qflag)
53#include <stdio.h>
54#include <stdlib.h>
55#include <string.h>
56#include <unistd.h>
57#include "extern.h"
58#include "pathnames.h"
59
60static int acct_load(char *, int);

--- 296 unchanged lines hidden (view full) ---

357
358 if (!uflag) {
359 /* and enter it into the usracct and pacct databases */
360 if (sflag || (!mflag && !qflag))
361 pacct_add(&ci);
362 if (sflag || (mflag && !qflag))
363 usracct_add(&ci);
364 } else if (!qflag)
364 printf("%6lu %12.2f cpu %12quk mem %12qu io %s\n",
365 printf("%6lu %12.2f cpu %12juk mem %12ju io %s\n",
365 ci.ci_uid,
366 (ci.ci_utime + ci.ci_stime) / (double) AHZ,
366 ci.ci_uid,
367 (ci.ci_utime + ci.ci_stime) / (double) AHZ,
367 ci.ci_mem, ci.ci_io, ci.ci_comm);
368 (uintmax_t)ci.ci_mem, (uintmax_t)ci.ci_io,
369 ci.ci_comm);
368 }
369
370 /* finally, return the file descriptor for possible truncation */
371 return (fd);
372}
373
374static u_quad_t
375decode_comp_t(comp)

--- 179 unchanged lines hidden ---
370 }
371
372 /* finally, return the file descriptor for possible truncation */
373 return (fd);
374}
375
376static u_quad_t
377decode_comp_t(comp)

--- 179 unchanged lines hidden ---