acct.h 1.1 KB

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