euidaccess
Section: C Library Functions (3)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
euidaccess, eaccess - ファイルへのアクセス権を実効ユーザーでチェックする
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#define _GNU_SOURCE /* feature_test_macros(7) 参照 */
#include <unistd.h>
int euidaccess(const char *path, int mode);
int eaccess(const char *path, int mode);
説明
Like access(2), euidaccess() checks permissions and existence of the
file identified by its argument path. However, whereas access(2)
performs checks using the real user and group identifiers of the process,
euidaccess() uses the effective identifiers.
mode は R_OK, W_OK, X_OK, F_OK の一つ以上から構成されるマスクである。 R_OK,
W_OK, X_OK, F_OK は access(2) と同じ意味を持つ。
eaccess() は euidaccess() の同義語であり、他のいくつかのシステムとの互換性のために提供されている。
返り値
On success (all requested permissions granted), zero is returned. On error
(at least one bit in mode asked for a permission that is denied, or some
other error occurred), -1 is returned, and errno is set to indicate the
error.
エラー
access(2) と同じ。
属性
この節で使用されている用語の説明については、 attributes(7) を参照。
| インターフェース | 属性 | 値
|
|
euidaccess(),
eaccess()
| Thread safety | MT-Safe
|
バージョン
Some other systems have an eaccess() function.
標準規格
なし。
歴史
- eaccess()
-
glibc 2.4.
注意
警告:
ある操作を実行する前にこの関数を使ってファイルに対するプロセスのアクセス許可を
確認してから、その情報に基づいて操作を行うと、競合条件が発生する可能性がある。
これは二つの操作の間でファイルのアクセス許可が変化する場合があるからである。
一般的には、必要な操作のみを行い、その際に発生したアクセス許可に関するエラーを
処理する方が安全である。
この関数は常にシンボリックリンクの展開を行う。
シンボリックリンクのアクセス許可を確認する必要がある場合は、
フラグ AT_EACCESS と AT_SYMLINK_NOFOLLOW を付けて
faccessat(2) を使うこと。
関連項目
access(2), chmod(2), chown(2), faccessat(2), open(2),
setgid(2), setuid(2), stat(2), credentials(7),
path_resolution(7)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- エラー
-
- 属性
-
- バージョン
-
- 標準規格
-
- 歴史
-
- 注意
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.