OSDN Git Service

ee0915aec64ce92d5f51f1fd898c5f087203807c
[linuxjm/LDP_man-pages.git] / release / man2 / openat.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 Yuichi SATO
26 .\"         all rights reserved.
27 .\" Translated 2006-09-27 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.39
28 .\"
29 .TH OPENAT 2 2009-12-13 "Linux" "Linux Programmer's Manual"
30 .SH Ì¾Á°
31 openat \- ¥Ç¥£¥ì¥¯¥È¥ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤éÁêÂÐŪ¤Ê°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë
32 .SH ½ñ¼°
33 .nf
34 .B #include <fcntl.h>
35 .sp
36 .BI "int openat(int " dirfd ", const char *" pathname ", int " flags );
37 .BI "int openat(int " dirfd ", const char *" pathname ", int " flags \
38 ", mode_t " mode );
39 .fi
40 .sp
41 .in -4n
42 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
43 .RB ( feature_test_macros (7)
44 »²¾È):
45 .in
46 .sp
47 .BR openat ():
48 .br
49 glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
50 .br
51 glibc 2.10 ¤è¤êÁ°:
52 _ATFILE_SOURCE
53 .SH ÀâÌÀ
54 .BR openat ()
55 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢
56 .BR open (2)
57 ¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£
58
59 .I pathname
60 ¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢
61 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
62 .I dirfd
63 ¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë
64 .RB ( open (2)
65 ¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤Î
66 ÁêÂХѥ¹¤È¤Ê¤ë)¡£
67
68 .I pathname
69 ¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä
70 .I dirfd
71 ¤¬ÆÃÊ̤ÊÃÍ
72 .B AT_FDCWD
73 ¤Ç¤¢¤ë¾ì¹ç¡¢
74 .I pathname
75 ¤Ï
76 .RB ( open (2)
77 ¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î
78 ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
79
80 .I pathname
81 ¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢
82 .I dirfd
83 ¤Ï̵»ë¤µ¤ì¤ë¡£
84 .SH ÊÖ¤êÃÍ
85 À®¸ù¤·¤¿¾ì¹ç¡¢
86 .BR openat ()
87 ¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£
88 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢
89 .I errno
90 ¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
91 .SH ¥¨¥é¡¼
92 .BR open (2)
93 ¤ÈƱ¤¸¥¨¥é¡¼¤¬
94 .BR openat ()
95 ¤Ç¤âµ¯¤³¤ë¡£
96 .BR openat ()
97 ¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë:
98 .TP
99 .B EBADF
100 .I dirfd
101 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
102 .TP
103 .B ENOTDIR
104 .I pathname
105 ¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä
106 .I dirfd
107 ¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
108 .SH ¥Ð¡¼¥¸¥ç¥ó
109 .BR openat ()
110 ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£
111 .SH ½àµò
112 POSIX.1-2008.
113 Solaris ¤Ë¤Ï¡¢¤³¤ì¤ÈƱ¤¸¤è¤¦¤Ê¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬Â¸ºß¤¹¤ë¡£
114 .\" The 'at' suffix in Solaris is actually double sensed.  It
115 .\" primarily referred to "extended *at*tributes", which are
116 .\" handled by Solaris' O_XATTR flag, but was also intended
117 .\" to refer to the notion of "at a relative location".
118 .\"
119 .\" See the following for a discussion of the inconsistent
120 .\" naming of the *at() functions:
121 .\" http://www.opengroup.org/austin/mailarchives/ag/msg09103.html
122 .\" Subject:    RE: The naming of at()s is a difficult matter
123 .\" From:       Don Cragun
124 .\" Date:       Tue, 14 Feb 2006 14:56:50 -0800 (PST)
125 .\"
126 .SH Ãí°Õ
127 .BR openat ()
128 ¤ä "at" ¤¬¸å¤í¤ËÉÕ¤¤¤¿¤½¤Î¾¤ÎƱÍͤΥ·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢
129 2 ¤Ä¤ÎÍýͳ¤Ë¤è¤êÄ󶡤µ¤ì¤Æ¤¤¤ë¡£
130
131 1 ¤ÄÌܤÎÍýͳ¤Ï¡¢
132 ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë·²¤ò
133 .BR open (2)
134 ¤Ç¥ª¡¼¥×¥ó¤¹¤ë¤È¤­¤Ëµ¯¤³¤ë²ÄǽÀ­¤¬¤¢¤ë¶¥¹ç¾õÂÖ (race condition) ¤ò¡¢
135 .BR openat ()
136 ¤Ë¤è¤Ã¤Æ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬²óÈò¤Ç¤­¤ë¤¿¤á¤Ç¤¢¤ë¡£
137 ¤³¤ì¤é¤Î¶¥¹ç¾õÂ֤ϡ¢
138 .BR open (2)
139 ¤Ë»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤Î
140 (/ ¤Ç¶èÀÚ¤é¤ì¤¿) ¤¤¤¯¤Ä¤«¤Î¹½À®Í×ÁÇ (¤ò¥ª¡¼¥×¥ó¤¹¤ë½èÍý) ¤¬¡¢
141 .BR open (2)
142 ¤òÊÂÎó¤Ë¸Æ¤Ó½Ð¤¹½èÍý¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¤Ëµ¯¤³¤ë¡£
143 ¤³¤Î¤è¤¦¤Ê¶¥¹ç¤Ï¡¢Âоݥǥ£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò¥ª¡¼¥×¥ó¤·¡¢
144 ¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò
145 .BR openat ()
146 ¤Î
147 .I dirfd
148 °ú¤­¿ô¤Ë»ØÄꤹ¤ë¤³¤È¤Ç²óÈò¤Ç¤­¤ë¡£
149
150 2 ¤ÄÌܤÎÍýͳ¤Ï¡¢
151 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ (·²) ¤ò»È¤¦¤³¤È¤Ç¡¢
152 .BR openat ()
153 ¤¬¥¹¥ì¥Ã¥ÉËè¤Î¤¤¤ï¤æ¤ë¡Ö¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¡×¤ò¼ÂÁõ¤Ç¤­¤ë¤¿¤á¤Ç¤¢¤ë¡£
154 (¤³¤Îµ¡Ç½¤Ï
155 .IR /proc/self/fd/ dirfd
156 ¤ò»È¤Ã¤¿Î¢µ»¤Ç¤â¼Â¸½¤Ç¤­¤ë¤¬¡¢¤¢¤Þ¤ê¸úΨŪ¤Ç¤Ï¤Ê¤¤)¡£
157 .SH ´ØÏ¢¹àÌÜ
158 .BR faccessat (2),
159 .BR fchmodat (2),
160 .BR fchownat (2),
161 .BR fstatat (2),
162 .BR futimesat (2),
163 .BR linkat (2),
164 .BR mkdirat (2),
165 .BR mknodat (2),
166 .BR open (2),
167 .BR readlinkat (2),
168 .BR renameat (2),
169 .BR symlinkat (2),
170 .BR unlinkat (2),
171 .BR utimensat (2),
172 .BR mkfifoat (3),
173 .BR path_resolution (7)