OSDN Git Service

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