OSDN Git Service

(split) Convert release and draft pages to UTF-8.
[linuxjm/LDP_man-pages.git] / release / man2 / faccessat.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" This manpage is Copyright (C) 2006, Michael Kerrisk
4 .\"
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .\" Japanese Version Copyright (c) 2006-2007 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated 2006-10-14 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
28 .\" Updated & Modified 2007-01-08 by Yuichi SATO, LDP v2.43
29 .\" Updated 2007-05-04, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
30 .\"
31 .TH FACCESSAT 2 2009-12-13 "Linux" "Linux Programmer's Manual"
32 .SH 名前
33 faccessat \- ディレクトリファイルディスクリプタから相対的な位置にある
34 ファイルのアクセス権をチェックする
35 .SH 書式
36 .nf
37 .B #include <fcntl.h>           /* AT_* 定数の定義 */
38 .B #include <unistd.h>
39 .sp
40 .BI "int faccessat(int " dirfd ", const char *" pathname ", int " \
41 mode ", int " flags );
42 .fi
43 .sp
44 .in -4n
45 glibc 向けの機能検査マクロの要件
46 .RB ( feature_test_macros (7)
47 参照):
48 .in
49 .sp
50 .BR faccessat ():
51 .PD 0
52 .ad l
53 .RS 4
54 .TP 4
55 glibc 2.10 以降:
56 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
57 .TP
58 glibc 2.10 より前:
59 _ATFILE_SOURCE
60 .RE
61 .ad
62 .PD
63 .SH 説明
64 .BR faccessat ()
65 システムコールは、この man ページで説明している違いがある以外は、
66 .BR access (2)
67 と全く同じように動作する。
68
69 .I pathname
70 で指定されるパス名が相対パスである場合、
71 ファイルディスクリプタ
72 .I dirfd
73 で参照されるディレクトリからの相対パス名として解釈される
74 .RB ( access (2)
75 では、相対パスは呼び出し元プロセスのカレントワーキングディレクトリからの
76 相対パスとなる)。
77
78 .I pathname
79 が相対パスであり、かつ
80 .I dirfd
81 が特別な値
82 .B AT_FDCWD
83 である場合、
84 .I pathname
85
86 .RB ( access (2)
87 と同じように) 呼び出し元プロセスの
88 カレントワーキングディレクトリからの相対パス名として解釈される。
89
90 .I pathname
91 が絶対パスである場合、
92 .I dirfd
93 は無視される。
94
95 .I flags
96 は以下の値を 0 個以上 OR して作られる。
97 .TP
98 .B AT_EACCESS
99 実効 (effective) ユーザ ID と実効グループ ID を使って、
100 アクセス権のチェックを行う。
101 デフォルトでは、
102 .BR faccessat ()
103
104 .RB ( access (2)
105 と同様に) 実 ID を使う。
106 .TP
107 .B AT_SYMLINK_NOFOLLOW
108 .I pathname
109 がシンボリックリンクの場合は、それを辿るのではなく、
110 リンク自身についての情報を返す。
111 .SH 返り値
112 成功した場合 (全ての要求された許可が得られたら)、
113 .BR faccessat ()
114 は 0 を返す。
115 エラーの場合、\-1 が返され、
116 .I errno
117 にはエラーを示す値が設定される。
118 .SH エラー
119 .BR access (2)
120 と同じエラーが
121 .BR faccessat ()
122 でも起こる。
123 .BR faccessat ()
124 では、その他に以下のエラーが起こる:
125 .TP
126 .B EBADF
127 .I dirfd
128 が有効なファイルディスクリプタでない。
129 .TP
130 .B EINVAL
131 .I flags
132 に不正なフラグ値が指定された。
133 .TP
134 .B ENOTDIR
135 .I pathname
136 が相対パスで、かつ
137 .I dirfd
138 がディレクトリ以外のファイルを参照するファイルディスクリプタである。
139 .SH バージョン
140 .BR faccessat ()
141 は Linux カーネル 2.6.16 で追加された。
142 .SH 準拠
143 POSIX.1-2008.
144 .SH 注意
145 .BR faccessat ()
146 が必要な理由については、
147 .BR openat (2)
148 を参照すること。
149 .SS glibc についての注意
150 .B AT_EACCESS
151
152 .B AT_SYMLINK_NOFOLLOW
153 フラグは、
154 .BR faccessat ()
155 の glibc ラッパー関数で実際に実装されている。
156 これらのフラグのいずれかが指定された場合、
157 ラッパー関数はアクセス権を決定するために
158 .BR fstatat (2)
159 を使う。
160 .SH 関連項目
161 .BR access (2),
162 .BR openat (2),
163 .BR eauidaccess (3),
164 .BR credentials (7),
165 .BR path_resolution (7),
166 .BR symlink (7)