OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[linuxjm/LDP_man-pages.git] / release / man5 / acct.5
1 .\" Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
24 .\"         all rights reserved.
25 .\" Translated 2008-08-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.05
26 .\" 
27 .\"WORD:        accounting      ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°
28 .\"
29 .TH ACCT 5 2008-06-15 "Linux" "Linux Programmer's Manual"
30 .SH Ì¾Á°
31 acct \- ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¡¦¥Õ¥¡¥¤¥ë
32 .SH ½ñ¼°
33 .B #include <sys/acct.h>
34 .SH ÀâÌÀ
35 ¥«¡¼¥Í¥ë¤¬¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Î¥ª¥×¥·¥ç¥ó
36 .RB ( CONFIG_BSD_PROCESS_ACCT )
37 ¤òÍ­¸ú¤Ë¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤ë¤È¡¢°Ê²¼¤Î¤è¤¦¤Ë
38 .BR acct (2)
39 ¤ò¸Æ¤Ó½Ð¤¹¤È¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬³«»Ï¤µ¤ì¤ë¡£
40
41 .in +4n
42  acct("/var/log/pacct");
43 .in
44
45 ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥«¡¼¥Í¥ë¤Ï
46 ¥·¥¹¥Æ¥à¾å¤Î³Æ¥×¥í¥»¥¹¤¬½ªÎ»¤¹¤ë¤¿¤Ó¤Ë¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë
47 ¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤à¡£
48 ¤³¤Î¥ì¥³¡¼¥É¤Ï¡¢½ªÎ»¤·¤¿¥×¥í¥»¥¹¤Ë´Ø¤¹¤ë¾ðÊó¤òÊÝ»ý¤¹¤ë¤â¤Î¤Ç¡¢
49 .I <sys/acct.h>
50 ¤Ç°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
51
52 .in +4n
53 .nf
54 #define ACCT_COMM 16
55
56 typedef u_int16_t comp_t;
57
58 struct acct {
59     char ac_flag;           /* Accounting flags */
60     u_int16_t ac_uid;       /* Accounting user ID */
61     u_int16_t ac_gid;       /* Accounting group ID */
62     u_int16_t ac_tty;       /* Controlling terminal */
63     u_int32_t ac_btime;     /* Process creation time
64                                (seconds since the Epoch) */
65     comp_t    ac_utime;     /* User CPU time */
66     comp_t    ac_stime;     /* System CPU time */
67     comp_t    ac_etime;     /* Elapsed time */
68     comp_t    ac_mem;       /* Average memory usage (kB) */
69     comp_t    ac_io;        /* Characters transferred (unused) */
70     comp_t    ac_rw;        /* Blocks read or written (unused) */
71     comp_t    ac_minflt;    /* Minor page faults */
72     comp_t    ac_majflt;    /* Major page faults */
73     comp_t    ac_swaps;     /* Number of swaps (unused) */
74     u_int32_t ac_exitcode;  /* Process termination status
75                                (see wait(2)) */
76     char      ac_comm[ACCT_COMM+1];
77                             /* Command name (basename of last
78                                executed command; null-terminated) */
79     char      ac_pad[\fIX\fP];    /* padding bytes */
80 };
81
82 enum {          /* Bits that may be set in ac_flag field */
83     AFORK = 0x01,           /* Has executed fork, but no exec */
84     ASU   = 0x02,           /* Used superuser privileges */
85     ACORE = 0x08,           /* Dumped core */
86     AXSIG = 0x10            /* Killed by a signal */
87 };
88 .fi
89 .in
90 .PP
91 ¥Ç¡¼¥¿·¿
92 .I comp_t
93 ¤ÏÉâÆ°¾®¿ôÅÀÃͤǡ¢3 ¥Ó¥Ã¥ÈÉý¤Î´ð¿ô¤¬ 8 ¤Î»Ø¿ôÉô¤È 13 ¥Ó¥Ã¥ÈÉý¤Î²¾¿ôÉô¤«¤é
94 ¹½À®¤µ¤ì¤ë¡£
95 .I comp_t
96 ·¿¤ÎÃÍ
97 .I c
98 ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ (long ·¿¤Î) À°¿ô¤ËÊÑ´¹¤Ç¤­¤ë¡£
99 .nf
100
101     v = (c & 0x1fff) << (((c >> 13) & 0x7) * 3);
102 .fi
103 .PP
104 ¥Õ¥£¡¼¥ë¥É
105 .IR ac_utime ,
106 .IR ac_stime ,
107 .I ac_etime
108 ¤Ï "clock ticks" Ã±°Ì¤Ç·×¬¤·¤¿»þ´Ö¤Ç¤¢¤ë¡£
109 ¤³¤ì¤é¤ÎÃͤò
110 .I sysconf(_SC_CLK_TCK)
111 ¤Ç³ä¤ë¤È¡¢ÉäËÊÑ´¹¤Ç¤­¤ë¡£
112 .SS ¥Ð¡¼¥¸¥ç¥ó 3 ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È
113 ¥«¡¼¥Í¥ë 2.6.8 °Ê¹ß¤Ç¤Ï¡¢
114 Ê̤ΥС¼¥¸¥ç¥ó¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢
115 ¤³¤ì¤ò»È¤¦¤Ë¤Ï¥«¡¼¥Í¥ë¹½ÃÛ»þ¤Ë
116 .B CONFIG_BSD_PROCESS_ACCT_V3
117 ¥ª¥×¥·¥ç¥ó¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£
118 ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤ë¤È¡¢¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤Þ¤ì¤ë
119 ¥ì¥³¡¼¥É¤Ë¥Õ¥£¡¼¥ë¥É¤¬Äɲ䵤ì¤ë¡£
120 ¤Þ¤¿¡¢¥Õ¥£¡¼¥ë¥É
121 .I c_uid
122 ¤È
123 .I ac_gid
124 ¤ÎÉý¤¬ 16 ¥Ó¥Ã¥È¤«¤é 32 ¥Ó¥Ã¥È¤Ë³ÈÄ¥¤µ¤ì¤ë
125 (¤³¤ì¤Ï Linux 2.4 °Ê¹ß¤Ç UID ¤È GID ¤Î¥µ¥¤¥º¤¬Áý¤¨¤Æ¤¤¤ë¤Î¤Ë
126 Âбþ¤·¤¿¤â¤Î¤Ç¤¢¤ë)¡£
127 ¤³¤Î¥ì¥³¡¼¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
128
129 .in +4n
130 .nf
131 struct acct_v3 {
132     char      ac_flag;      /* Flags */
133     char      ac_version;   /* Always set to ACCT_VERSION (3) */
134     u_int16_t ac_tty;       /* Controlling terminal */
135     u_int32_t ac_exitcode;  /* Process termination status */
136     u_int32_t ac_uid;       /* Real user ID */
137     u_int32_t ac_gid;       /* Real group ID */
138     u_int32_t ac_pid;       /* Process ID */
139     u_int32_t ac_ppid;      /* Parent process ID */
140     u_int32_t ac_btime;     /* Process creation time */
141     float     ac_etime;     /* Elapsed time */
142     comp_t    ac_utime;     /* User CPU time */
143     comp_t    ac_stime;     /* System time */
144     comp_t    ac_mem;       /* Average memory usage (kB) */
145     comp_t    ac_io;        /* Characters transferred (unused) */
146     comp_t    ac_rw;        /* Blocks read or written
147                                (unused) */
148     comp_t    ac_minflt;    /* Minor page faults */
149     comp_t    ac_majflt;    /* Major page faults */
150     comp_t    ac_swaps;     /* Number of swaps (unused) */
151     char      ac_comm[ACCT_COMM]; /* Command name */
152 };
153
154 .fi
155 .in
156 .SH ¥Ð¡¼¥¸¥ç¥ó
157 .I acct_v3
158 ¹½Â¤ÂΤϥС¼¥¸¥ç¥ó 2.6 °Ê¹ß¤Î glibc ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
159 .SH ½àµò
160 ¥×¥í¥»¥¹¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤Ï BSD Í³Íè¤Ç¤¢¤ë¡£
161 ¤³¤Îµ¡Ç½¤Ï¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¤¬¡¢É¸½à²½¤µ¤ì¤Æ¤ª¤é¤º¡¢
162 ¤½¤Î¾ÜºÙ¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤ê¤¤¤¯¤é¤«°Û¤Ê¤ë¡£
163 .SH Ãí°Õ
164 ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥¤¥ë¤Î¥ì¥³¡¼¥É¤Ï¡¢¥×¥í¥»¥¹¤Î½ªÎ»»þ¹ï¤Î½ç½ø¤È¤Ê¤ë¡£
165
166 ¥Ð¡¼¥¸¥ç¥ó 2.6.9 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
167 NPTL ¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥¹¥ì¥Ã¥É¤Ç¤Ï
168 ¥¹¥ì¥Ã¥ÉËè¤ËÊÌ¡¹¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬½ñ¤­¹þ¤Þ¤ì¤Æ¤¤¤¿¡£
169 Linux 2.6.10 °Ê¹ß¤Ç¤Ï¡¢¥×¥í¥»¥¹Æâ¤ÎºÇ¸å¤Î¥¹¥ì¥Ã¥É¤¬½ªÎ»¤¹¤ë¤È¡¢
170 ¥×¥í¥»¥¹Á´ÂΤˤĤ¤¤Æ¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤¬°ì¤Ä¤À¤±½ñ¤­¹þ¤Þ¤ì¤ë¡£
171
172 .I proc/sys/kernel/acct
173 ¥Õ¥¡¥¤¥ë
174 .RB ( proc (5)
175 ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ë) ¤Ï¡¢¥Ç¥£¥¹¥¯ÍÆÎ̤λĤ꤬¾¯¤Ê¤¯¤Ê¤Ã¤¿ºÝ¤Î
176 ¥×¥í¥»¥¹¡¦¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ÎÆ°ºî¤òÀ©¸æ¤¹¤ëÀßÄê¤òÊÝ»ý¤·¤Æ¤¤¤ë¡£
177 .SH ´ØÏ¢¹àÌÜ
178 .BR lastcomm (1),
179 .BR acct (2),
180 .BR accton (8),
181 .BR sa (8)