.\" Copyright (c) 1993 Michael Haardt .\" (michael@moria.de), .\" Fri Apr 2 11:32:09 MET DST 1993 .\" .\" %%%LICENSE_START(GPLv2+_DOC_FULL) .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, see .\" . .\" %%%LICENSE_END .\" .\" Modified 1993-07-22 by Rik Faith .\" Modified 1993-08-10 by Alan Cox .\" Modified 1998-11-04 by Tigran Aivazian .\" Modified 2004-05-27, 2004-06-17, 2004-06-23 by Michael Kerrisk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya .\" all rights reserved. .\" Translated 1997-02-22, HANATAKA Shinya .\" Modified 1998-11-30, HANATAKA Shinya .\" Updated and Modified 2001-06-02, Yuichi SATO .\" Updated and Modified 2001-10-15, Yuichi SATO .\" Updated and Modified 2004-12-28, Yuichi SATO .\" Updated 2008-08-04, Akihiro MOTOKI .\" .TH ACCT 2 2016\-03\-15 Linux "Linux Programmer's Manual" .SH 名前 acct \- プロセスアカウントのオンとオフを切り換える .SH 書式 .ad l .nf \fB#include \fP .PP \fBint acct(const char *\fP\fIfilename\fP\fB);\fP .fi .ad b .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBacct\fP(): .nf .\" commit 266865c0e7b79d4196e2cc393693463f03c90bd8 Since glibc 2.21: _DEFAULT_SOURCE In glibc 2.19 and 2.20: _DEFAULT_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) Up to and including glibc 2.19: _BSD_SOURCE || (_XOPEN_SOURCE && _XOPEN_SOURCE\ <\ 500) .fi .SH 説明 \fBacct\fP() システムコールは、プロセスアカウントの有効・無効を切り替える。 既存のファイルの名前を引数に指定して呼び出されたら、 アカウント (account) が有効になり、 終了したプロセスの記録が \fIfilename\fP に追記される。 NULL を引数として呼び出されたらアカウントをオフにする。 .SH 返り値 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。 .SH エラー .TP \fBEACCES\fP 指定したファイルへの書き込み許可がなく、書き込みが拒否された。 または \fIfilename\fP のディレクトリ部分の何れかのディレクトリに検索許可がなく拒否された (\fBpath_resolution\fP(7) も参照すること)。 または \fIfilename\fP が通常 (regular) のファイルでない。 .TP \fBEFAULT\fP アクセスできるアドレス空間の外を \fIfilename\fP が指している。 .TP \fBEIO\fP \fIfilename\fP への書き込みにエラーが発生した。 .TP \fBEISDIR\fP \fIfilename\fP がディレクトリである。 .TP \fBELOOP\fP \fIfilename\fP の実体にたどり着くまでのシンボリックリンクの数が多すぎる。 .TP \fBENAMETOOLONG\fP \fIfilename\fP が長すぎる。 .TP \fBENFILE\fP オープンされたファイルの総数がシステム全体の制限に達した。 .TP \fBENOENT\fP 指定されたファイルが存在しない。 .TP \fBENOMEM\fP メモリー不足。 .TP \fBENOSYS\fP カーネルをコンパイルした時に BSD プロセスアカウントが有効になっていない。 この機能はカーネルのコンフィグの \fBCONFIG_BSD_PROCESS_ACCT\fP パラメーターによって制御される。 .TP \fBENOTDIR\fP \fIfilename\fP の中でディレクトリして扱われている要素が、 実際はディレクトリでない。 .TP \fBEPERM\fP 呼び出したプロセスにはプロセスアカウントを有効にするのに十分な特権がない。 Linux では \fBCAP_SYS_PACCT\fP ケーパビリティ (capability) が必要である。 .TP \fBEROFS\fP 読み込みだけのファイルシステム上のファイルを \fIfilename\fP が参照している。 .TP \fBEUSERS\fP 使用可能なファイル構造体がないか、メモリーが足りない。 .SH 準拠 .\" SVr4 documents an EBUSY error condition, but no EISDIR or ENOSYS. .\" Also AIX and HP-UX document EBUSY (attempt is made .\" to enable accounting when it is already enabled), as does Solaris .\" (attempt is made to enable accounting using the same file that is .\" currently being used). SVr4, 4.3BSD (POSIX ではない)。 .SH 注意 システムがクラッシュした時に実行中だったプログラムのアカウントは生成されない。 特に、終了しないプログラムがアカウントされることはない。 .PP アカウント用ファイルに書き込まれるレコードの構造体については \fBacct\fP(5) に説明がある。 .SH 関連項目 \fBacct\fP(5) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。