- 论坛徽章:
- 0
|
本帖最后由 yizhongchuanqi 于 2011-11-02 15:16 编辑
kernel中的acct.h文件里定义了一个结构体这里面的几个unused的变量什么时候可以用啊?有木有大侠知道的,小弟这种问题找不到合适的地方可以问所以发这来了
DESCRIPTION top
If the kernel is built with the process accounting option enabled
(CONFIG_BSD_PROCESS_ACCT), then calling acct(2) starts process accounting, for
example:
acct("/var/log/pacct");
When process accounting is enabled, the kernel writes a record to the
accounting file as each process on the system terminates. This record
contains information about the terminated process, and is defined in
<sys/acct.h> as follows:
#define ACCT_COMM 16
typedef u_int16_t comp_t;
struct acct {
char ac_flag; /* Accounting flags */
u_int16_t ac_uid; /* Accounting user ID */
u_int16_t ac_gid; /* Accounting group ID */
u_int16_t ac_tty; /* Controlling terminal */
u_int32_t ac_btime; /* Process creation time
(seconds since the Epoch) */
comp_t ac_utime; /* User CPU time */
comp_t ac_stime; /* System CPU time */
comp_t ac_etime; /* Elapsed time */
comp_t ac_mem; /* Average memory usage (kB) */
comp_t ac_io; /* Characters transferred (unused) */
comp_t ac_rw; /* Blocks read or written (unused) */
comp_t ac_minflt; /* Minor page faults */
comp_t ac_majflt; /* Major page faults */
comp_t ac_swaps; /* Number of swaps (unused) */
u_int32_t ac_exitcode; /* Process termination status
(see wait(2)) */
char ac_comm[ACCT_COMM+1];
/* Command name (basename of last
executed command; null-terminated) */
char ac_pad[X]; /* padding bytes */
};
原文链接http://www.kernel.org/doc/man-pages/online/pages/man5/acct.5.html |
|