OSDN Git Service

82fa108b68367ad34ee3e07c09343927a9de53d8
[linuxjm/LDP_man-pages.git] / draft / man2 / acct.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (c) 1993 Michael Haardt
4 .\" (michael@moria.de),
5 .\" Fri Apr  2 11:32:09 MET DST 1993
6 .\"
7 .\" This is free documentation; you can redistribute it and/or
8 .\" modify it under the terms of the GNU General Public License as
9 .\" published by the Free Software Foundation; either version 2 of
10 .\" the License, or (at your option) any later version.
11 .\"
12 .\" The GNU General Public License's references to "object code"
13 .\" and "executables" are to be interpreted as the output of any
14 .\" document formatting or typesetting system, including
15 .\" intermediate and printed output.
16 .\"
17 .\" This manual is distributed in the hope that it will be useful,
18 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 .\" GNU General Public License for more details.
21 .\"
22 .\" You should have received a copy of the GNU General Public
23 .\" License along with this manual; if not, write to the Free
24 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
25 .\" USA.
26 .\"
27 .\" Modified 1993-07-22 by Rik Faith <faith@cs.unc.edu>
28 .\" Modified 1993-08-10 by Alan Cox <iiitac@pyramid.swansea.ac.uk>
29 .\" Modified 1998-11-04 by Tigran Aivazian <tigran@sco.com>
30 .\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk
31 .\"
32 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
33 .\"         all rights reserved.
34 .\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Modified 1998-11-30, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Updated and Modified 2001-06-02, Yuichi SATO <ysato@h4.dion.ne.jp>
37 .\" Updated and Modified 2001-10-15, Yuichi SATO
38 .\" Updated and Modified 2004-12-28, Yuichi SATO <ysato444@yahoo.co.jp>
39 .\" Updated 2008-08-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
40 .\"
41 .\"WORD:        account                 アカウント
42 .\"WORD:        process                 プロセス
43 .\"
44 .TH ACCT 2 2008-06-16 "Linux" "Linux Programmer's Manual"
45 .\"O .SH NAME
46 .SH 名前
47 .\"O acct \- switch process accounting on or off
48 acct \- プロセス・アカウントのオンとオフを切り換える
49 .\"O .SH SYNOPSIS
50 .SH 書式
51 .ad l
52 .nf
53 .B #include <unistd.h>
54 .sp
55 .BI "int acct(const char *" filename );
56 .fi
57 .ad b
58 .sp
59 .in -4n
60 .\"O Feature Test Macro Requirements for glibc (see
61 .\"O .BR feature_test_macros (7)):
62 glibc 向けの機能検査マクロの要件
63 .RB ( feature_test_macros (7)
64 参照):
65 .in
66 .sp
67 .BR acct ():
68 _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500)
69 .\"O .SH DESCRIPTION
70 .SH 説明
71 .\"O The
72 .\"O .BR acct ()
73 .\"O system call enables or disables process accounting.
74 .\"O If called with the name of an existing file as its argument,
75 .\"O accounting is turned on,
76 .\"O and records for each terminating process are appended to
77 .\"O \fIfilename\fP as it terminates.
78 .\"O An argument of NULL causes accounting to be turned off.
79 .BR acct ()
80 システムコールは、プロセス・アカウントの有効・無効を切り替える。
81 既存のファイルの名前を引き数に指定して呼び出されたら、
82 アカウント (account) が有効になり、
83 終了したプロセスの記録が \fIfilename\fP に追記される。
84 NULL を引き数として呼び出されたらアカウントをオフにする。
85 .\"O .SH "RETURN VALUE"
86 .SH 返り値
87 .\"O On success, zero is returned.
88 .\"O On error, \-1 is returned, and
89 .\"O .I errno
90 .\"O is set appropriately.
91 成功した場合は 0 が返される。エラーの場合は \-1 が返され、
92 .I errno
93 が適切に設定される。
94 .\"O .SH ERRORS
95 .SH エラー
96 .TP
97 .B EACCES
98 .\"O Write permission is denied for the specified file.
99 指定したファイルへの書き込み許可がなく、書き込みが拒否された。
100 .TP
101 .B EACCES
102 .\"O Write permission is denied for the specified file,
103 指定したファイルへの書き込み許可がなく、書き込みが拒否された。
104 .\"O or search permission is denied for one of the directories
105 .\"O in the path prefix of
106 .\"O .I filename
107 .\"O (see also
108 .\"O .BR path_resolution (7)),
109 または
110 .I filename
111 のディレクトリ部分の何れかのディレクトリに検索許可がなく拒否された
112 .RB ( path_resolution (7)
113 も参照すること)。
114 .\"O or
115 .\"O .I filename
116 .\"O is not a regular file.
117 または
118 .I filename
119 が通常 (regular) のファイルでない。
120 .TP
121 .B EFAULT
122 .\"O .I filename
123 .\"O points outside your accessible address space.
124 アクセスできるアドレス空間の外を
125 .I filename
126 が指している。
127 .TP
128 .B EIO
129 .\"O Error writing to the file
130 .\"O .IR filename .
131 .I filename
132 への書き込みにエラーが発生した。
133 .TP
134 .B EISDIR
135 .\"O .I filename
136 .\"O is a directory.
137 .I filename
138 がディレクトリである。
139 .TP
140 .B ELOOP
141 .\"O Too many symbolic links were encountered in resolving
142 .\"O .IR filename .
143 .I filename
144 の実体にたどり着くまでのシンボリックリンクの数が多すぎる。
145 .TP
146 .B ENAMETOOLONG
147 .\"O .I filename
148 .\"O was too long.
149 .I filename
150 が長すぎる。
151 .TP
152 .B ENFILE
153 .\"O The system limit on the total number of open files has been reached.
154 オープンされたファイルの総数がシステム制限に達した。
155 .TP
156 .B ENOENT
157 .\"O The specified filename does not exist.
158 指定されたファイルが存在しない。
159 .TP
160 .B ENOMEM
161 .\"O Out of memory.
162 メモリが足りない。
163 .TP
164 .B ENOSYS
165 .\"O BSD process accounting has not been enabled when the operating system
166 .\"O kernel was compiled.
167 .\"O The kernel configuration parameter controlling this feature is
168 .\"O .BR CONFIG_BSD_PROCESS_ACCT .
169 カーネルをコンパイルした時に BSD プロセス・アカウントが有効になっていない。
170 この機能はカーネルのコンフィグの
171 .B CONFIG_BSD_PROCESS_ACCT
172 パラメータによって制御される。
173 .TP
174 .B ENOTDIR
175 .\"O A component used as a directory in
176 .\"O .I filename
177 .\"O is not in fact a directory.
178 .I filename
179 の中でディレクトリして扱われている要素が、
180 実際はディレクトリでない。
181 .TP
182 .B EPERM
183 .\"O The calling process has insufficient privilege to enable process accounting.
184 呼び出したプロセスにはプロセス・アカウントを有効にするのに十分な特権がない。
185 .\"O On Linux the
186 .\"O .B CAP_SYS_PACCT
187 .\"O capability is required.
188 Linux では
189 .B CAP_SYS_PACCT
190 ケーパビリティ (capability) が必要である。
191 .TP
192 .B EROFS
193 .\"O .I filename
194 .\"O refers to a file on a read-only file system.
195 読み込みだけのファイルシステム上のファイルを
196 .I filename
197 が参照している。
198 .TP
199 .B EUSERS
200 .\"O There are no more free file structures or we ran out of memory.
201 使用可能なファイル構造体がないか、メモリが足りない。
202 .\"O .SH "CONFORMING TO"
203 .SH 準拠
204 .\"O SVr4, 4.3BSD (but not POSIX).
205 .\"O .\" SVr4 documents an EBUSY error condition,
206 .\"O .\" but no EISDIR or ENOSYS. Also AIX and HPUX document EBUSY (attempt is made
207 .\"O .\" to enable accounting when it is already enabled), as does Solaris
208 .\"O .\" (attempt is made to enable accounting using the same file that is
209 .\"O .\" currently being used).
210 SVr4, 4.3BSD (POSIX ではない)。
211 .\" SVr4 には EBUSY エラーが記述されているが、EISDIR, ENOSYS はない。
212 .\" AIX と HPUX には、EBUSY について「すでにアカウントが有効にされている場合に、
213 .\" さらに有効にしようとした」という記述がある。
214 .\" これは Solaris における「現在、アカウントに使われているファイルと
215 .\" 同じファイルでアカウントを有効にしようとした」という記述と同じである。
216 .\"O .SH NOTES
217 .SH 注意
218 .\"O No accounting is produced for programs running when a system crash occurs.
219 .\"O In particular, nonterminating processes are never accounted for.
220 システムがクラッシュした時に実行中だったプログラムのアカウントは生成されない。
221 特に、終了しないプログラムがアカウントされることはない。
222
223 .\"O The structure of the records written to the accounting file is described in
224 .\"O .BR acct (5).
225 アカウント用ファイルに書き込まれるレコードの構造体については
226 .BR acct (5)
227 に説明がある。
228 .\"O .SH "SEE ALSO"
229 .SH 関連項目
230 .\"O .BR acct (5)
231 .BR acct (5)