1 /*- 2 * Copyright (c) 1990, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)acct.h 8.4 (Berkeley) 01/09/95 13 */ 14 15 /* 16 * Accounting structures; these use a comp_t type which is a 3 bits base 8 17 * exponent, 13 bit fraction ``floating point'' number. Units are 1/AHZ 18 * seconds. 19 */ 20 typedef u_int16_t comp_t; 21 22 struct acct { 23 char ac_comm[10]; /* command name */ 24 comp_t ac_utime; /* user time */ 25 comp_t ac_stime; /* system time */ 26 comp_t ac_etime; /* elapsed time */ 27 time_t ac_btime; /* starting time */ 28 uid_t ac_uid; /* user id */ 29 gid_t ac_gid; /* group id */ 30 u_int16_t ac_mem; /* average memory usage */ 31 comp_t ac_io; /* count of IO blocks */ 32 dev_t ac_tty; /* controlling tty */ 33 34 #define AFORK 0x01 /* fork'd but not exec'd */ 35 #define ASU 0x02 /* used super-user permissions */ 36 #define ACOMPAT 0x04 /* used compatibility mode */ 37 #define ACORE 0x08 /* dumped core */ 38 #define AXSIG 0x10 /* killed by a signal */ 39 u_int8_t ac_flag; /* accounting flags */ 40 }; 41 42 /* 43 * 1/AHZ is the granularity of the data encoded in the comp_t fields. 44 * This is not necessarily equal to hz. 45 */ 46 #define AHZ 64 47 48 #ifdef KERNEL 49 struct vnode *acctp; 50 51 int acct_process __P((struct proc *p)); 52 #endif 53