1
0

acct.h 1.1 KB

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