OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[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 .br
55 .\"O Since glibc 2.10: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
56 glibc 2.10 °Ê¹ß: _XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
57 .br
58 .\"O Before glibc 2.10:
59 glibc 2.10 ¤è¤êÁ°:
60 _ATFILE_SOURCE
61 .\"O .SH DESCRIPTION
62 .SH ÀâÌÀ
63 .\"O The
64 .\"O .BR linkat ()
65 .\"O system call operates in exactly the same way as
66 .\"O .BR link (2),
67 .\"O except for the differences described in this manual page.
68 .BR linkat ()
69 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¤³¤Î man ¥Ú¡¼¥¸¤ÇÀâÌÀ¤·¤Æ¤¤¤ë°ã¤¤¤¬¤¢¤ë°Ê³°¤Ï¡¢
70 .BR link (2)
71 ¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£
72
73 .\"O If the pathname given in
74 .\"O .I oldpath
75 .\"O is relative, then it is interpreted relative to the directory
76 .\"O referred to by the file descriptor
77 .\"O .I olddirfd
78 .\"O (rather than relative to the current working directory of
79 .\"O the calling process, as is done by
80 .\"O .BR link (2)
81 .\"O for a relative pathname).
82 .I oldpath
83 ¤Ç»ØÄꤵ¤ì¤ë¥Ñ¥¹Ì¾¤¬ÁêÂХѥ¹Ì¾¤Ç¤¢¤ë¾ì¹ç¡¢
84 ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
85 .I olddirfd
86 ¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë
87 .RB ( link (2)
88 ¤Ç¤Ï¡¢ÁêÂХѥ¹¤Ï¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î
89 ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤È¤Ê¤ë)¡£
90
91 .\"O If
92 .\"O .I oldpath
93 .\"O is relative and
94 .\"O .I olddirfd
95 .\"O is the special value
96 .\"O .BR AT_FDCWD ,
97 .\"O then
98 .\"O .I oldpath
99 .\"O is interpreted relative to the current working
100 .\"O directory of the calling process (like
101 .\"O .BR link (2)).
102 .I oldpath
103 ¤¬ÁêÂХѥ¹¤Ç¤¢¤ê¡¢¤«¤Ä
104 .I olddirfd
105 ¤¬ÆÃÊ̤ÊÃÍ
106 .B AT_FDCWD
107 ¤Ç¤¢¤ë¾ì¹ç¡¢
108 .I oldpath
109 ¤Ï
110 .RB ( link (2)
111 ¤ÈƱ¤¸¤è¤¦¤Ë) ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î
112 ¥«¥ì¥ó¥È¥ï¡¼¥­¥ó¥°¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
113
114 .\"O If
115 .\"O .I oldpath
116 .\"O is absolute, then
117 .\"O .I olddirfd
118 .\"O is ignored.
119 .I oldpath
120 ¤¬ÀäÂХѥ¹¤Ç¤¢¤ë¾ì¹ç¡¢
121 .I olddirfd
122 ¤Ï̵»ë¤µ¤ì¤ë¡£
123
124 .\"O The interpretation of
125 .\"O .I newpath
126 .\"O is as for
127 .\"O .IR oldpath ,
128 .\"O except that a relative pathname is interpreted relative
129 .\"O to the directory referred to by the file descriptor
130 .\"O .IR newdirfd .
131 .I newpath
132 ¤Î²ò¼á¤Ï
133 .I oldpath
134 ¤ÈƱÍͤǤ¢¤ë¤¬¡¢
135 ÁêÂХѥ¹Ì¾¤Ï¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿
136 .I newdirfd
137 ¤Ç»²¾È¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹Ì¾¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£
138
139 .\"O By default,
140 .\"O .BR linkat (),
141 .\"O does not dereference
142 .\"O .I oldpath
143 .\"O if it is a symbolic link (like
144 .\"O .BR link (2)).
145 .\"O Since Linux 2.6.18, the flag
146 .\"O .B AT_SYMLINK_FOLLOW
147 .\"O can be specified in
148 .\"O .I flags
149 .\"O to cause
150 .\"O .I oldpath
151 .\"O to be dereferenced if it is a symbolic link.
152 .\"O Before kernel 2.6.18, the
153 .\"O .I flags
154 .\"O argument was unused, and had to be specified as 0.
155 ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
156 .I oldpath
157 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¡¢
158 .RB ( link (2)
159 ƱÍÍ)
160 .BR linkat ()
161 ¤Ï
162 .I oldpath
163 ¤Î»²¾È¤Î²ò·è¤ò¹Ô¤ï¤Ê¤¤¡£
164 Linux 2.6.18 °Ê¹ß¤Ç¤Ï¡¢
165 .B AT_SYMLINK_FOLLOW
166 ¥Õ¥é¥°¤ò
167 .I flags
168 ¤Ë»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤³¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤È¡¢
169 .I oldpath
170 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¡¢
171 .I oldpath
172 ¤Î»²¾È¤Î²ò·è¤ò¹Ô¤¦¡£
173 2.6.18 °ÊÁ°¤Î¥«¡¼¥Í¥ë¤Ç¤Ï¡¢
174 .I flags
175 °ú¤­¿ô¤Ï»ÈÍѤµ¤ì¤º¡¢
176 0 ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡£
177 .\"O .SH "RETURN VALUE"
178 .SH ÊÖ¤êÃÍ
179 .\"O On success,
180 .\"O .BR linkat ()
181 .\"O returns 0.
182 À®¸ù¤·¤¿¾ì¹ç¡¢
183 .BR linkat ()
184 ¤Ï 0 ¤òÊÖ¤¹¡£
185 .\"O On error, \-1 is returned and
186 .\"O .I errno
187 .\"O is set to indicate the error.
188 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤¬ÊÖ¤µ¤ì¤Æ¡¢
189 .I errno
190 ¤Ë¤Ï¥¨¥é¡¼¤ò¼¨¤¹Ãͤ¬ÀßÄꤵ¤ì¤ë¡£
191 .\"O .SH ERRORS
192 .SH ¥¨¥é¡¼
193 .\"O The same errors that occur for
194 .\"O .BR link (2)
195 .\"O can also occur for
196 .\"O .BR linkat ().
197 .BR link (2)
198 ¤ÈƱ¤¸¥¨¥é¡¼¤¬
199 .BR linkat ()
200 ¤Ç¤âµ¯¤³¤ë¡£
201 .\"O The following additional errors can occur for
202 .\"O .BR linkat ():
203 .BR linkat ()
204 ¤Ç¤Ï¡¢¤½¤Î¾¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬µ¯¤³¤ë:
205 .TP
206 .B EBADF
207 .\"O .I olddirfd
208 .\"O or
209 .\"O .I newdirfd
210 .\"O is not a valid file descriptor.
211 .I olddirfd
212 ¤Þ¤¿¤Ï
213 .I newdirfd
214 ¤¬Í­¸ú¤Ê¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ê¤¤¡£
215 .TP
216 .B ENOTDIR
217 .\"O .I oldpath
218 .\"O is relative and
219 .\"O .I olddirfd
220 .\"O is a file descriptor referring to a file other than a directory;
221 .I oldpath
222 ¤¬ÁêÂХѥ¹¤Ç¡¢¤«¤Ä
223 .I olddirfd
224 ¤¬¥Ç¥£¥ì¥¯¥È¥ê°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
225 .\"O or similar for
226 .\"O .I newpath
227 .\"O and
228 .\"O .I newdirfd
229 ¤Þ¤¿¤Ï
230 .I newpath
231 ¤È
232 .I newdirfd
233 ¤Ë¤Ä¤¤¤Æ¡¢Æ±ÍͤΤ³¤È¤¬µ¯¤­¤Æ¤¤¤ë¡£
234 .\"O .SH VERSIONS
235 .SH ¥Ð¡¼¥¸¥ç¥ó
236 .\"O .BR linkat ()
237 .\"O was added to Linux in kernel 2.6.16.
238 .BR linkat ()
239 ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.16 ¤ÇÄɲ䵤줿¡£
240 .\"O .SH "CONFORMING TO"
241 .SH ½àµò
242 POSIX.1-2008.
243 .\"O .SH NOTES
244 .SH Ãí°Õ
245 .\"O See
246 .\"O .BR openat (2)
247 .\"O for an explanation of the need for
248 .\"O .BR linkat ().
249 .BR linkat ()
250 ¤¬É¬ÍפÊÍýͳ¤Ë¤Ä¤¤¤Æ¤Ï¡¢
251 .BR openat (2)
252 ¤ò»²¾È¤¹¤ë¤³¤È¡£
253 .\"O .SH "SEE ALSO"
254 .SH ´ØÏ¢¹àÌÜ
255 .BR link (2),
256 .BR openat (2),
257 .BR path_resolution (7),
258 .BR symlink (7)