acct.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _SYS_ACCT_H
  16. #define _SYS_ACCT_H 1
  17. #include <features.h>
  18. #define __need_time_t
  19. #include <time.h>
  20. #include <sys/types.h>
  21. __BEGIN_DECLS
  22. #define ACCT_COMM 16
  23. /*
  24. comp_t is a 16-bit "floating" point number with a 3-bit base 8
  25. exponent and a 13-bit fraction. See linux/kernel/acct.c for the
  26. specific encoding system used.
  27. */
  28. typedef u_int16_t comp_t;
  29. struct acct
  30. {
  31. char ac_flag; /* Accounting flags. */
  32. u_int16_t ac_uid; /* Accounting user ID. */
  33. u_int16_t ac_gid; /* Accounting group ID. */
  34. u_int16_t ac_tty; /* Controlling tty. */
  35. u_int32_t ac_btime; /* Beginning time. */
  36. comp_t ac_utime; /* Accounting user time. */
  37. comp_t ac_stime; /* Accounting system time. */
  38. comp_t ac_etime; /* Accounting elapsed time. */
  39. comp_t ac_mem; /* Accounting average memory usage. */
  40. comp_t ac_io; /* Accounting chars transferred. */
  41. comp_t ac_rw; /* Accounting blocks read or written. */
  42. comp_t ac_minflt; /* Accounting minor pagefaults. */
  43. comp_t ac_majflt; /* Accounting major pagefaults. */
  44. comp_t ac_swaps; /* Accounting number of swaps. */
  45. u_int32_t ac_exitcode; /* Accounting process exitcode. */
  46. char ac_comm[ACCT_COMM+1]; /* Accounting command name. */
  47. char ac_pad[10]; /* Accounting padding bytes. */
  48. };
  49. enum
  50. {
  51. AFORK = 0x01, /* Has executed fork, but no exec. */
  52. ASU = 0x02, /* Used super-user privileges. */
  53. ACORE = 0x08, /* Dumped core. */
  54. AXSIG = 0x10 /* Killed by a signal. */
  55. };
  56. #define AHZ 100
  57. /* Switch process accounting on and off. */
  58. extern int acct (__const char *__filename) __THROW;
  59. __END_DECLS
  60. #endif /* sys/acct.h */