home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / apps / 2879 < prev    next >
Encoding:
Text File  |  1992-12-30  |  3.8 KB  |  138 lines

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.sys.sun.apps
  4. Subject: Re: tacct.h file - anyone?
  5. Keywords: accounting, tacct
  6. Message-ID: <16173@auspex-gw.auspex.com>
  7. Date: 31 Dec 92 00:30:46 GMT
  8. References: <1992Dec30.192126.14399@statoil.no>
  9. Sender: news@auspex-gw.auspex.com
  10. Organization: Auspex Systems, Santa Clara
  11. Lines: 124
  12. Nntp-Posting-Host: auspex.auspex.com
  13.  
  14. >  The file  acct.h  is available in /usr/include, but nowhere is
  15. >  tacct.h  to be found. It is just referred to in the manual -
  16. >  "written on the tacct format"...
  17.  
  18. Oops.  I forgot to note that the "ACCT(5)" manual page needed to be
  19. updated when I left instructions on how to put the SV accounting stuff
  20. into SunOS.
  21.  
  22. >  Hopefully someone out there have this one file, and can send it
  23. >  via email or something.
  24.  
  25. The manual page should have said, as the SV manual page said, that the
  26. "tacct" stuff "resides with the source files of the accounting
  27. commands".  In any case, here's what the SunOS 4.1[.x] ACCT(5) man page
  28. should have said:
  29.  
  30. .\" @(#)acct.5 1.14 90/02/15 SMI; from UCB 4.2
  31. .TH ACCT 5 "19 October 1987"
  32. .SH NAME
  33. acct \- accounting file formats
  34. .SH SYNOPSIS
  35. .B #include <sys/acct.h>
  36. .SH DESCRIPTION
  37. .IX  "acct"  "\fLacct\fP \(em execution accounting file" "\fLacct\fR"
  38. .IX  "execution accounting file"  ""  "execution accounting file \(em \fLacct\fP"
  39. .IX  "accounting file"  ""  "accounting file \(em \fLacct\fP"
  40. The
  41. .BR acct (2V)
  42. system call makes entries in an accounting file
  43. for each process that terminates.
  44. The accounting file is a sequence of entries whose layout,
  45. as defined by the include file is:
  46. .LP
  47. .RS
  48. .nf
  49. .ft B
  50. typedef    u_short comp_t;
  51.  
  52. struct  acct
  53. {
  54.     char    ac_flag;        /* Accounting flag */
  55.     char    ac_stat;        /* Exit status */
  56.     uid_t    ac_uid;            /* Accounting user ID */
  57.     gid_t    ac_gid;            /* Accounting group ID */
  58.     dev_t    ac_tty;            /* control typewriter */
  59.     time_t    ac_btime;        /* Beginning time */
  60.     comp_t    ac_utime;        /* Accounting user time */
  61.     comp_t    ac_stime;        /* Accounting system time */
  62.     comp_t    ac_etime;        /* Accounting elapsed time */
  63.     comp_t    ac_mem;            /* average memory usage */
  64.     comp_t    ac_io;            /* chars transferred */
  65.     comp_t    ac_rw;            /* blocks read or written */
  66.     char    ac_comm[8];        /* Accounting command name */
  67. };
  68.  
  69. #define    AFORK    0001        /* has executed fork, but no exec */
  70. #define    ASU    0002        /* used super-user privileges */
  71. #define    ACOMPAT    0004        /* used compatibility mode */
  72. #define    ACORE    0010        /* dumped core */
  73. #define    AXSIG    0020        /* killed by a signal */
  74. #define    ACCTF    0300        /* record type: 00 = acct */
  75. .ft
  76. .fi
  77. .RE
  78. .LP
  79. The type
  80. .B comp_t
  81. is a 3 bits base 8
  82. exponent, 13 bit fraction ``floating point'' number.
  83. If the process does an
  84. .BR execve (2V),
  85. the first 8 characters of the filename appear in
  86. .BR ac_comm .
  87. .LP
  88. In
  89. .BR ac_flag ,
  90. the
  91. .B \s-1AFORK\s0
  92. is turned on by each
  93. .BR fork (2V)
  94. and turned off by
  95. .BR execve (2V).
  96. .B \s-1ASU\s0
  97. is turned on if a process has super-user privileges and uses them;
  98. .B \s-1AXSIG\s0
  99. is turned on if the process is killed by a signal, and
  100. .B \s-1ACORE\s0
  101. is turned on if the process dumps core as a result.
  102. .LP
  103. The
  104. .B tacct
  105. structure, which resides with the source files of the accounting
  106. commands, represents the total accounting format used by the various
  107. accounting commands:
  108. .LP
  109. .RS
  110. .nf
  111. .ft B
  112. /*
  113.  *    total accounting (for acct period), also for day
  114.  */
  115.  
  116. struct    tacct    {
  117.     uid_t        ta_uid;        /* userid */
  118.     char        ta_name[8];    /* login name */
  119.     float        ta_cpu[2];    /* cum. cpu time, p/np (mins) */
  120.     float        ta_kcore[2];    /* cum kcore-minutes, p/np */
  121.     float        ta_con[2];    /* cum. connect time, p/np, mins */
  122.     float        ta_du;        /* cum. disk usage */
  123.     long        ta_pc;        /* count of processes */
  124.     unsigned short    ta_sc;        /* count of login sessions */
  125.     unsigned short    ta_dc;        /* count of disk samples */
  126.     unsigned short    ta_fee;        /* fee for special services */
  127. };
  128. .ft
  129. .fi
  130. .RE
  131. .SH SEE ALSO
  132. .BR acctcom (1),
  133. .BR acct (2V),
  134. .BR execve (2V),
  135. .BR fork (2V),
  136. .BR acct (8),
  137. .BR sa (8)
  138.