OSDN Git Service

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