main.c (8857) | main.c (13558) |
---|---|
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 --- 19 unchanged lines hidden (view full) --- 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#ifndef LINT 32static char copright[] = 33"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\ 34 All rights reserved.\n"; 35 | 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 --- 19 unchanged lines hidden (view full) --- 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31#ifndef LINT 32static char copright[] = 33"@(#) Copyright (c) 1994 Christopher G. Demetriou\n\ 34 All rights reserved.\n"; 35 |
36static char rcsid[] = "$Id: main.c,v 1.1.1.1 1994/09/26 21:22:56 davidg Exp $"; | 36static char rcsid[] = "$Id: main.c,v 1.2 1995/05/30 03:51:39 rgrimes Exp $"; |
37#endif 38 39/* 40 * sa: system accounting 41 */ 42 43#include <sys/types.h> 44#include <sys/acct.h> 45#include <ctype.h> 46#include <err.h> 47#include <fcntl.h> 48#include <signal.h> 49#include <stdio.h> 50#include <stdlib.h> | 37#endif 38 39/* 40 * sa: system accounting 41 */ 42 43#include <sys/types.h> 44#include <sys/acct.h> 45#include <ctype.h> 46#include <err.h> 47#include <fcntl.h> 48#include <signal.h> 49#include <stdio.h> 50#include <stdlib.h> |
51#include <string.h> |
|
51#include <unistd.h> 52#include "extern.h" 53#include "pathnames.h" 54 55static int acct_load __P((char *, int)); 56static u_quad_t decode_comp_t __P((comp_t)); 57static int cmp_comm __P((const char *, const char *)); 58static int cmp_usrsys __P((const DBT *, const DBT *)); --- 285 unchanged lines hidden (view full) --- 344 345 if (!uflag) { 346 /* and enter it into the usracct and pacct databases */ 347 if (sflag || (!mflag && !qflag)) 348 pacct_add(&ci); 349 if (sflag || (mflag && !qflag)) 350 usracct_add(&ci); 351 } else if (!qflag) | 52#include <unistd.h> 53#include "extern.h" 54#include "pathnames.h" 55 56static int acct_load __P((char *, int)); 57static u_quad_t decode_comp_t __P((comp_t)); 58static int cmp_comm __P((const char *, const char *)); 59static int cmp_usrsys __P((const DBT *, const DBT *)); --- 285 unchanged lines hidden (view full) --- 345 346 if (!uflag) { 347 /* and enter it into the usracct and pacct databases */ 348 if (sflag || (!mflag && !qflag)) 349 pacct_add(&ci); 350 if (sflag || (mflag && !qflag)) 351 usracct_add(&ci); 352 } else if (!qflag) |
352 printf("%6u %12.2lf cpu %12quk mem %12qu io %s\n", | 353 printf("%6lu %12.2f cpu %12quk mem %12qu io %s\n", |
353 ci.ci_uid, 354 (ci.ci_utime + ci.ci_stime) / (double) AHZ, 355 ci.ci_mem, ci.ci_io, ci.ci_comm); 356 } 357 358 /* finally, return the file descriptor for possible truncation */ 359 return (fd); 360} --- 182 unchanged lines hidden --- | 354 ci.ci_uid, 355 (ci.ci_utime + ci.ci_stime) / (double) AHZ, 356 ci.ci_mem, ci.ci_io, ci.ci_comm); 357 } 358 359 /* finally, return the file descriptor for possible truncation */ 360 return (fd); 361} --- 182 unchanged lines hidden --- |