1 #ifndef _SYS_ACCT_H 2 #define _SYS_ACCT_H 3 4 #ifdef __cplusplus 5 extern "C" { 6 #endif 7 8 #include <features.h> 9 #include <time.h> 10 #include <stdint.h> 11 12 #define ACCT_COMM 16 13 14 typedef uint16_t comp_t; 15 16 struct acct { 17 char ac_flag; 18 uint16_t ac_uid; 19 uint16_t ac_gid; 20 uint16_t ac_tty; 21 uint32_t ac_btime; 22 comp_t ac_utime; 23 comp_t ac_stime; 24 comp_t ac_etime; 25 comp_t ac_mem; 26 comp_t ac_io; 27 comp_t ac_rw; 28 comp_t ac_minflt; 29 comp_t ac_majflt; 30 comp_t ac_swaps; 31 uint32_t ac_exitcode; 32 char ac_comm[ACCT_COMM+1]; 33 char ac_pad[10]; 34 }; 35 36 37 struct acct_v3 { 38 char ac_flag; 39 char ac_version; 40 uint16_t ac_tty; 41 uint32_t ac_exitcode; 42 uint32_t ac_uid; 43 uint32_t ac_gid; 44 uint32_t ac_pid; 45 uint32_t ac_ppid; 46 uint32_t ac_btime; 47 float ac_etime; 48 comp_t ac_utime; 49 comp_t ac_stime; 50 comp_t ac_mem; 51 comp_t ac_io; 52 comp_t ac_rw; 53 comp_t ac_minflt; 54 comp_t ac_majflt; 55 comp_t ac_swaps; 56 char ac_comm[ACCT_COMM]; 57 }; 58 59 #define AFORK 1 60 #define ASU 2 61 #define ACORE 8 62 #define AXSIG 16 63 #define ACCT_BYTEORDER (128*(__BYTE_ORDER==__BIG_ENDIAN)) 64 #define AHZ 100 65 66 int acct(const char *); 67 68 #ifdef __cplusplus 69 } 70 #endif 71 72 #endif 73