OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / faccessat.2
1 .\" This manpage is Copyright (C) 2006, Michael Kerrisk
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\"*******************************************************************
26 .\"
27 .\" This file was generated with po4a. Translate the source file.
28 .\"
29 .\"*******************************************************************
30 .\"
31 .\" Japanese Version Copyright (c) 2006-2007 Yuichi SATO
32 .\"         all rights reserved.
33 .\" Translated 2006-10-14 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
34 .\" Updated & Modified 2007-01-08 by Yuichi SATO, LDP v2.43
35 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
36 .\"
37 .TH FACCESSAT 2 2012\-05\-04 Linux "Linux Programmer's Manual"
38 .SH 名前
39 faccessat \- ディレクトリファイルディスクリプタから相対的な位置にある ファイルのアクセス権をチェックする
40 .SH 書式
41 .nf
42 \fB#include <fcntl.h> /* AT_* 定数の定義 */\fP
43 \fB#include <unistd.h>\fP
44 .sp
45 \fBint faccessat(int \fP\fIdirfd\fP\fB, const char *\fP\fIpathname\fP\fB, int \fP\fImode\fP\fB, int \fP\fIflags\fP\fB);\fP
46 .fi
47 .sp
48 .in -4n
49 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
50 .in
51 .sp
52 \fBfaccessat\fP():
53 .PD 0
54 .ad l
55 .RS 4
56 .TP  4
57 glibc 2.10 以降:
58 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
59 .TP 
60 glibc 2.10 より前:
61 _ATFILE_SOURCE
62 .RE
63 .ad
64 .PD
65 .SH 説明
66 \fBfaccessat\fP()  システムコールは、この man ページで説明している違いがある以外は、 \fBaccess\fP(2)
67 と全く同じように動作する。
68
69 \fIpathname\fP で指定されるパス名が相対パスである場合、 ファイルディスクリプタ \fIdirfd\fP
70 で参照されるディレクトリからの相対パス名として解釈される (\fBaccess\fP(2)
71 では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの 相対パスとなる)。
72
73 \fIpathname\fP が相対パスであり、かつ \fIdirfd\fP が特別な値 \fBAT_FDCWD\fP である場合、 \fIpathname\fP は
74 (\fBaccess\fP(2)  と同じように) 呼び出し元プロセスの カレントワーキングディレクトリからの相対パス名として解釈される。
75
76 \fIpathname\fP が絶対パスである場合、 \fIdirfd\fP は無視される。
77
78 \fIflags\fP は以下の値を 0 個以上 OR して作られる。
79 .TP 
80 \fBAT_EACCESS\fP
81 実効 (effective) ユーザ ID と実効グループ ID を使って、 アクセス権のチェックを行う。 デフォルトでは、
82 \fBfaccessat\fP()  は (\fBaccess\fP(2)  と同様に) 実 ID を使う。
83 .TP 
84 \fBAT_SYMLINK_NOFOLLOW\fP
85 \fIpathname\fP がシンボリックリンクの場合は、それを辿るのではなく、 リンク自身についての情報を返す。
86 .SH 返り値
87 成功した場合 (全ての要求された許可が得られたら)、 \fBfaccessat\fP()  は 0 を返す。 エラーの場合、\-1 が返され、 \fIerrno\fP
88 にはエラーを示す値が設定される。
89 .SH エラー
90 \fBaccess\fP(2)  と同じエラーが \fBfaccessat\fP()  でも起こる。 \fBfaccessat\fP()
91 では、その他に以下のエラーが起こる:
92 .TP 
93 \fBEBADF\fP
94 \fIdirfd\fP が有効なファイルディスクリプタでない。
95 .TP 
96 \fBEINVAL\fP
97 \fIflags\fP に不正なフラグ値が指定された。
98 .TP 
99 \fBENOTDIR\fP
100 \fIpathname\fP が相対パスで、かつ \fIdirfd\fP がディレクトリ以外のファイルを参照するファイルディスクリプタである。
101 .SH バージョン
102 \fBfaccessat\fP()  は Linux カーネル 2.6.16 で追加された。
103 ライブラリによるサポートは glibc バージョン 2.4 で追加された。
104 .SH 準拠
105 POSIX.1\-2008.
106 .SH 注意
107 \fBfaccessat\fP()  が必要な理由については、 \fBopenat\fP(2)  を参照すること。
108
109 \fI警告\fP: \fBfaccessat\fP() は \fBaccess\fP(2) や \fBeuidaccess\fP(3) と同様の
110 競合状態が起こり得る。
111 .SS "glibc についての注意"
112 \fBAT_EACCESS\fP と \fBAT_SYMLINK_NOFOLLOW\fP フラグは、 \fBfaccessat\fP()  の glibc
113 ラッパー関数で実際に実装されている。 これらのフラグのいずれかが指定された場合、 ラッパー関数はアクセス権を決定するために \fBfstatat\fP(2)
114 を使う。
115 .SH 関連項目
116 \fBaccess\fP(2), \fBopenat\fP(2), \fBeauidaccess\fP(3), \fBcredentials\fP(7),
117 \fBpath_resolution\fP(7), \fBsymlink\fP(7)
118 .SH この文書について
119 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
120 である。プロジェクトの説明とバグ報告に関する情報は
121 http://www.kernel.org/doc/man\-pages/ に書かれている。