|
|
1.1 root 1:
2:
3: acct.h Header File acct.h
4:
5:
6:
7:
8: Format for process-accounting file
9:
10: #include <acct.h>
11:
12: Process accounting is a feature of the COHERENT system that
13: allows it record what processes each user executes and how long
14: each process takes. These data can be used to track how much
15: each user uses the system.
16:
17: The function acct turns process accounting off or on. When
18: process accounting has been turned on, the COHERENT system writes
19: raw process-accounting information into an accounting file as
20: each process terminates. Each entry in the accounting file, nor-
21: mally /usr/adm/acct, has the following form, as defined in the
22: header file aacccctt.hh:
23:
24:
25: struct acct {
26: char ac_comm[10];
27: comp_t ac_utime;
28: comp_t ac_stime;
29: comp_t ac_etime;
30: time_t ac_btime;
31: short ac_uid;
32: short ac_gid;
33: short ac_mem;
34: comp_t ac_io;
35: dev_t ac_tty;
36: char ac_flag;
37: };
38:
39:
40:
41: /* Bits from ac_flag */
42: #define AFORK 01 /* has done fork, but not exec */
43: #define ASU 02 /* has used superuser privileges */
44:
45:
46: Every time a process performs an exec call, the contents of
47: ac_comm are replaced with the first ten characters of the file
48: name. The fields ac_utime and ac_stime represent the CPU time
49: used in the user program and in the system, respectively.
50: ac_etime represents the elapsed time since the process started
51: running, whereas ac_btime is the time the process started. The
52: effective user id and effective group id are ac_uid and ac_gid.
53: ac_mem gives the average memory usage of the process. ac_io
54: gives the number of blocks of input-output. ac_tty gives the
55: controlling typewriter device major and minor numbers.
56:
57: For some of the above times, the acct structure uses the special
58: representation comp_t, defined in the header file types.h. It is
59: a floating point representation with three bits of base-8 ex-
60: ponent and 13 bits of fraction, so it fits in a short integer.
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
67:
68:
69: acct.h Header File acct.h
70:
71:
72:
73: ***** See Also *****
74:
75: acct(), accton, header files, sa
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130: COHERENT Lexicon Page 2
131:
132:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.