OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / 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 .\"O .SH NAME
33 .SH Ì¾Á°
34 .\"O faccessat \- check user's permissions of a file relative to a \
35 .\"O directory file descriptor
36 faccessat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë
37 ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤ò¥Á¥§¥Ã¥¯¤¹¤ë
38 .\"O .SH SYNOPSIS
39 .SH ½ñ¼°
40 .nf
41 .\"O .B #include <fcntl.h>           /* Definition of AT_* constants */
42 .B #include <fcntl.h>           /* AT_* Äê¿ô¤ÎÄêµÁ */
43 .B #include <unistd.h>
44 .sp
45 .BI "int faccessat(int " dirfd ", const char *" pathname ", int " \
46 mode ", int " flags );
47 .fi
48 .sp
49 .in -4n
50 .\"O Feature Test Macro Requirements for glibc (see
51 .\"O .BR feature_test_macros (7)):
52 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
53 .RB ( feature_test_macros (7)
54 »²¾È):
55 .in
56 .sp
57 .BR faccessat ():
58 .PD 0
59 .ad l
60 .RS 4
61 .TP 4
62 .\"O Since glibc 2.10:
63 glibc 2.10 °Ê¹ß:
64 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
65 .TP
66 .\"O Before glibc 2.10:
67 glibc 2.10 ¤è¤êÁ°:
68 _ATFILE_SOURCE
69 .RE
70 .ad
71 .PD
72 .\"O .SH DESCRIPTION
73 .SH ÀâÌÀ
74 .\"O The
75 .\"O .BR faccessat ()
76 .\"O system call operates in exactly the same way as
77 .\"O .BR access (2),
78 .\"O except for the differences described in this manual page.
79 .BR faccessat ()
80 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢
81 .BR access (2)
82 ¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£
83
84 .\"O If the pathname given in
85 .\"O .I pathname
86 .\"O is relative, then it is interpreted relative to the directory
87 .\"O referred to by the file descriptor
88 .\"O .I dirfd
89 .\"O (rather than relative to the current working directory of
90 .\"O the calling process, as is done by
91 .\"O .BR access (2)
92 .\"O for a relative pathname).
93 .I pathname
94 ¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢
95 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
96 .I dirfd
97 ¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë
98 .RB ( access (2)
99 ¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î
100 ÁêÂХѥ¹¤È¤Ê¤ë)¡£
101
102 .\"O If
103 .\"O .I pathname
104 .\"O is relative and
105 .\"O .I dirfd
106 .\"O is the special value
107 .\"O .BR AT_FDCWD ,
108 .\"O then
109 .\"O .I pathname
110 .\"O is interpreted relative to the current working
111 .\"O directory of the calling process (like
112 .\"O .BR access (2)).
113 .I pathname
114 ¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä
115 .I dirfd
116 ¤¬ÆÃÊ̤ÊÃÍ
117 .B AT_FDCWD
118 ¤Ç¤¢¤ë¾ì¹ç¡¢
119 .I pathname
120 ¤Ï
121 .RB ( access (2)
122 ¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î
123 ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
124
125 .\"O If
126 .\"O .I pathname
127 .\"O is absolute, then
128 .\"O .I dirfd
129 .\"O is ignored.
130 .I pathname
131 ¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢
132 .I dirfd
133 ¤Ï̵»ë¤µ¤ì¤ë¡£
134
135 .\"O .I flags
136 .\"O is constructed by ORing together zero or more of the following values:
137 .I flags
138 ¤Ï°Ê²¼¤ÎÃͤò 0 ¸Ä°Ê¾å OR ¤·¤Æºî¤é¤ì¤ë¡£
139 .TP
140 .B AT_EACCESS
141 .\"O Perform access checks using the effective user and group IDs.
142 .\"O By default,
143 .\"O .BR faccessat ()
144 .\"O uses the real IDs (like
145 .\"O .BR access (2)).
146 ¼Â¸ú (effective) ¥æ¡¼¥¶ ID ¤È¼Â¸ú¥°¥ë¡¼¥× ID ¤ò»È¤Ã¤Æ¡¢
147 ¥¢¥¯¥»¥¹¸¢¤Î¥Á¥§¥Ã¥¯¤ò¹Ô¤¦¡£
148 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
149 .BR faccessat ()
150 ¤Ï
151 .RB ( access (2)
152 ¤ÈƱÍͤË) ¼Â ID ¤ò»È¤¦¡£
153 .TP
154 .B AT_SYMLINK_NOFOLLOW
155 .\"O If
156 .\"O .I pathname
157 .\"O is a symbolic link, do not dereference it:
158 .\"O instead return information about the link itself.
159 .I pathname
160 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤òé¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢
161 ¥ê¥ó¥¯¼«¿È¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¡£
162 .\"O .SH "RETURN VALUE"
163 .SH ÊÖ¤êÃÍ
164 .\"O On success, (all requested permissions granted)
165 .\"O .BR faccessat ()
166 .\"O returns 0.
167 À®¸ù¤·¤¿¾ì¹ç (Á´¤Æ¤ÎÍ׵ᤵ¤ì¤¿µö²Ä¤¬ÆÀ¤é¤ì¤¿¤é)¡¢
168 .BR faccessat ()
169 ¤Ï 0 ¤òÊÖ¤¹¡£
170 .\"O On error, \-1 is returned and
171 .\"O .I errno
172 .\"O is set to indicate the error.
173 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¡¢
174 .I errno
175 ¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
176 .\"O .SH ERRORS
177 .SH ¥¨¥é¡¼
178 .\"O The same errors that occur for
179 .\"O .BR access (2)
180 .\"O can also occur for
181 .\"O .BR faccessat ().
182 .BR access (2)
183 ¤ÈƱ¤¸¥¨¥é¡¼¤¬
184 .BR faccessat ()
185 ¤Ç¤âµ¯¤³¤ë¡£
186 .\"O The following additional errors can occur for
187 .\"O .BR faccessat ():
188 .BR faccessat ()
189 ¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë:
190 .TP
191 .B EBADF
192 .\"O .I dirfd
193 .\"O is not a valid file descriptor.
194 .I dirfd
195 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
196 .TP
197 .B EINVAL
198 .\"O Invalid flag specified in
199 .\"O .IR flags .
200 .I flags
201 ¤ËÉÔÀµ¤Ê¥Õ¥é¥°Ãͤ¬»ØÄꤵ¤ì¤¿¡£
202 .TP
203 .B ENOTDIR
204 .\"O .I pathname
205 .\"O is relative and
206 .\"O .I dirfd
207 .\"O is a file descriptor referring to a file other than a directory.
208 .I pathname
209 ¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä
210 .I dirfd
211 ¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
212 .\"O .SH VERSIONS
213 .SH ¥Ð¡¼¥¸¥ç¥ó
214 .\"O .BR faccessat ()
215 .\"O was added to Linux in kernel 2.6.16.
216 .BR faccessat ()
217 ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£
218 .\"O .SH "CONFORMING TO"
219 .SH ½àµò
220 POSIX.1-2008.
221 .\"O .SH NOTES
222 .SH Ãí°Õ
223 .\"O See
224 .\"O .BR openat (2)
225 .\"O for an explanation of the need for
226 .\"O .BR faccessat ().
227 .BR faccessat ()
228 ¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
229 .BR openat (2)
230 ¤ò»²¾È¤¹¤ë¤³¤È¡£
231 .\"O .SS Glibc Notes
232 .SS glibc ¤Ë¤Ä¤¤¤Æ¤ÎÃí°Õ
233 .\"O The
234 .\"O .B AT_EACCESS
235 .\"O and
236 .\"O .B AT_SYMLINK_NOFOLLOW
237 .\"O flags are actually implemented within the glibc wrapper function for
238 .\"O .BR faccessat ().
239 .B AT_EACCESS
240 ¤È
241 .B AT_SYMLINK_NOFOLLOW
242 ¥Õ¥é¥°¤Ï¡¢
243 .BR faccessat ()
244 ¤Î glibc ¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ç¼ÂºÝ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
245 .\"O If either of these flags are specified, then the wrapper function employs
246 .\"O .BR fstatat (2)
247 .\"O to determine access permissions.
248 ¤³¤ì¤é¤Î¥Õ¥é¥°¤Î¤¤¤º¤ì¤«¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢
249 ¥é¥Ã¥Ñ¡¼´Ø¿ô¤Ï¥¢¥¯¥»¥¹¸¢¤ò·èÄꤹ¤ë¤¿¤á¤Ë
250 .BR fstatat (2)
251 ¤ò»È¤¦¡£
252 .\"O .SH "SEE ALSO"
253 .SH ´ØÏ¢¹àÌÜ
254 .BR access (2),
255 .BR openat (2),
256 .BR eauidaccess (3),
257 .BR credentials (7),
258 .BR path_resolution (7),
259 .BR symlink (7)