acctのヘルプ・マニュアル
日本語 英語
acct --help
man acct
ACCT(2) Linux Programmer’s Manual ACCT(2)
名前
acct - プロセス・アカウントのオンとオフを切り換える
書式
#include
int acct(const char *filename);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
acct(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
説明
acct() システムコールは、プロセス・アカウントの有効・無効を切り替える。
既存のファイルの名前を引き数に指定して呼び出された ら 、 ア カ ウ ン ト
(account) が有効になり、終了したプロセスの記録が filename に追記される
。 NULL を引き数として呼び出されたらアカウントをオフにする。
返り値
成功した場合は 0 が返される。エラーの場合は -1 が返され、 errno が適 切
に設定される。
エラー
EACCES 指定したファイルへの書き込み許可がなく、書き込みが拒否された。
EACCES 指定したファイルへの書き込み許可がなく、書き込みが拒否された。ま
たは filename のディレクトリ部分の何れかのディレクトリに検索許可
が な く 拒 否された (path_resolution(7) も参照すること)。または
filename が通常 (regular) のファイルでない。
EFAULT アクセスできるアドレス空間の外を filename が指している。
EIO filename への書き込みにエラーが発生した。
EISDIR filename がディレクトリである。
ELOOP filename の実体にたどり着くまでのシンボリックリンクの数が多す ぎ
る。
ENAMETOOLONG
filename が長すぎる。
ENFILE オープンされたファイルの総数がシステム制限に達した。
ENOENT 指定されたファイルが存在しない。
ENOMEM メモリが足りない。
ENOSYS カーネルをコンパイルした時に BSD プロセス・アカウントが有効にな
っていない。この機能はカーネルのコンフ ィ グ の CONFIG_BSD_PRO-
CESS_ACCT パラメータによって制御される。
ENOTDIR
filename の中でディレクトリして扱われている要素が、実際はディレ
クトリでない。
EPERM 呼び出したプロセスにはプロセス・アカウントを有効にするのに十分な
特 権 がない。 Linux では CAP_SYS_PACCT ケーパビリティ (capabil-
ity) が必要である。
EROFS 読み込みだけのファイルシステム上のファイルを filename が参照して
いる。
EUSERS 使用可能なファイル構造体がないか、メモリが足りない。
準拠
SVr4, 4.3BSD (POSIX ではない)。
注意
シ ステムがクラッシュした時に実行中だったプログラムのアカウントは生成さ
れない。特に、終了しないプログラムがアカウントされることはない。
アカウント用ファイルに書き込まれるレコードの構造体については acct(5) に
説明がある。
関連項目
acct(5)
Linux 2008-06-16 ACCT(2)
ACCT(2) Linux Programmer’s Manual ACCT(2)
NAME
acct - switch process accounting on or off
SYNOPSIS
#include
int acct(const char *filename);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
acct(): _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE < 500)
DESCRIPTION
The acct() system call enables or disables process accounting. If
called with the name of an existing file as its argument, accounting is
turned on, and records for each terminating process are appended to
filename as it terminates. An argument of NULL causes accounting to be
turned off.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is
set appropriately.
ERRORS
EACCES Write permission is denied for the specified file, or search
permission is denied for one of the directories in the path pre-
fix of filename (see also path_resolution(7)), or filename is
not a regular file.
EFAULT filename points outside your accessible address space.
EIO Error writing to the file filename.
EISDIR filename is a directory.
ELOOP Too many symbolic links were encountered in resolving filename.
ENAMETOOLONG
filename was too long.
ENFILE The system limit on the total number of open files has been
reached.
ENOENT The specified filename does not exist.
ENOMEM Out of memory.
ENOSYS BSD process accounting has not been enabled when the operating
system kernel was compiled. The kernel configuration parameter
controlling this feature is CONFIG_BSD_PROCESS_ACCT.
ENOTDIR
A component used as a directory in filename is not in fact a
directory.
EPERM The calling process has insufficient privilege to enable process
accounting. On Linux the CAP_SYS_PACCT capability is required.
EROFS filename refers to a file on a read-only file system.
EUSERS There are no more free file structures or we ran out of memory.
CONFORMING TO
SVr4, 4.3BSD (but not POSIX).
NOTES
No accounting is produced for programs running when a system crash
occurs. In particular, non-terminating processes are never accounted
for.
The structure of the records written to the accounting file is
described in acct(5).
SEE ALSO
acct(5)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2008-06-16 ACCT(2)