1
0

acct.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. {
  14. char ac_flag;
  15. uint16_t ac_uid;
  16. uint16_t ac_gid;
  17. uint16_t ac_tty;
  18. uint32_t ac_btime;
  19. comp_t ac_utime;
  20. comp_t ac_stime;
  21. comp_t ac_etime;
  22. comp_t ac_mem;
  23. comp_t ac_io;
  24. comp_t ac_rw;
  25. comp_t ac_minflt;
  26. comp_t ac_majflt;
  27. comp_t ac_swaps;
  28. uint32_t ac_exitcode;
  29. char ac_comm[ACCT_COMM+1];
  30. char ac_pad[10];
  31. };
  32. struct acct_v3
  33. {
  34. char ac_flag;
  35. char ac_version;
  36. uint16_t ac_tty;
  37. uint32_t ac_exitcode;
  38. uint32_t ac_uid;
  39. uint32_t ac_gid;
  40. uint32_t ac_pid;
  41. uint32_t ac_ppid;
  42. uint32_t ac_btime;
  43. float ac_etime;
  44. comp_t ac_utime;
  45. comp_t ac_stime;
  46. comp_t ac_mem;
  47. comp_t ac_io;
  48. comp_t ac_rw;
  49. comp_t ac_minflt;
  50. comp_t ac_majflt;
  51. comp_t ac_swaps;
  52. char ac_comm[ACCT_COMM];
  53. };
  54. #define AFORK 1
  55. #define ASU 2
  56. #define ACORE 8
  57. #define AXSIG 16
  58. #define ACCT_BYTEORDER (128*(__BYTE_ORDER==__BIG_ENDIAN))
  59. #define AHZ 100
  60. int acct(const char *);
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif