1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
4 .\" 1993 Michael Haardt, Ian Jackson.
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
26 .\" Modified 1993-07-23 by Rik Faith <faith@cs.unc.edu>
27 .\" Modified 1994-08-21 by Michael Haardt
28 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
29 .\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2
31 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
32 .\" all rights reserved.
33 .\" Translated Thu Dec 11 23:47:55 JST 1997
34 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Updated & Modified Tue Feb 8 06:36:08 JST 2005
36 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
37 .\" Updated & Modified Fri Apr 22 02:05:00 JST 2005 by Yuichi SATO
38 .\" Updated 2008-09-07, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.08
41 .\"WORD: hard link ¥Ï¡¼¥É¡¦¥ê¥ó¥¯
42 .\"WORD: overwrite ¾å½ñ¤
43 .\"WORD: permission µö²Ä(permission)
44 .\"WORD: ownership ½êͼÔ(ownership)
45 .\"WORD: file system ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à
46 .\"WORD: effective uid ¼Â¸ú¥æ¡¼¥¶¡¼ID
47 .\"WORD: kernel ¥«¡¼¥Í¥ë
48 .\"WORD: symbolic link ¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯
49 .\"WORD: dangling symbolic link ²õ¤ì¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯
50 .\"WORD: directory entry ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê
52 .TH LINK 2 2008-08-21 "Linux" "Linux Programmer's Manual"
54 link \- ¥Õ¥¡¥¤¥ë¤Î¿·¤·¤¤Ì¾Á°¤òºîÀ®¤¹¤ë
56 .B #include <unistd.h>
58 .BI "int link(const char *" oldpath ", const char *" newpath );
61 ¤Ï¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ø¤Î¿·¤·¤¤¥ê¥ó¥¯ (link)
62 (¥Ï¡¼¥É¡¦¥ê¥ó¥¯ (hard link) ¤È¤â¤¤¤¦) ¤òºîÀ®¤¹¤ë¡£
65 ¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ë¤Ï¾å½ñ¤¤Ï\fI¤µ¤ì¤Ê¤¤\fR¡£
67 ¤³¤Î¿·¤·¤¤Ì¾Á°¤ÏÁ´¤Æ¤ÎÁàºî¤Ë¤ª¤¤¤Æ¸Å¤¤Ì¾Á°¤È´°Á´¤ËƱ¤¸¤è¤¦¤Ë»ÈÍѤµ¤ì¤ë;
68 ξÊý¤Î̾Á°¤ÏƱ¤¸¥Õ¥¡¥¤¥ë¤ò»²¾È¤·¤Æ¤ª¤ê
69 (¤½¤ì¤ÇƱ¤¸µö²Ä (permission) ¤ä½êÍ¼Ô (ownership) ¤È¤Ê¤ë¤Î¤Ç)¡¢
70 ¤É¤Á¤é¤Î̾Á°¤¬ËÜÍè¤Î¤â¤Î¤Ç¤¢¤ë¤«È½Ê̤Ǥ¤Ê¤¤¡£
72 À®¸ù¤·¤¿¾ì¹ç¤Ï 0 ¤¬ÊÖ¤µ¤ì¤ë¡£¥¨¥é¡¼¤Î¾ì¹ç¤Ï \-1 ¤¬ÊÖ¤µ¤ì¡¢
79 ¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î½ñ¤¹þ¤ß¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢
83 ¤Ø¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤É¤ì¤«¤Ë¸¡º÷µö²Ä¤¬¤Ê¤¤
84 .RB ( path_resolution (7)
92 .IR oldpath " ¤Þ¤¿¤Ï " newpath "
93 ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö¤Î³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
96 I/O ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
99 .IR oldpath " ¤Þ¤¿¤Ï " newpath
100 ¤ò²ò·è¤¹¤ëºÝ¤ËÁø¶ø¤·¤¿¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¬Â¿²á¤®¤ë¡£
104 ¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤Ï
105 ´û¤ËºÇÂç¿ô¤Þ¤Ç¤Î¥ê¥ó¥¯¤ò»ý¤Ã¤Æ¤¤¤ë¡£
108 .IR oldpath " ¤Þ¤¿¤Ï " newpath "
112 .IR oldpath " ¤Þ¤¿¤Ï " newpath
113 ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢
114 ²õ¤ì¤¿(dangling)¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¡£
117 ¥«¡¼¥Í¥ë¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤¤¡£
120 ¤½¤Î¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç¤¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¿·¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê¤ò
121 ºîÀ®¤¹¤ë¤¿¤á¤Î¶õ¤¤¬¤Ê¤¤¡£
124 .IR oldpath " ¤Þ¤¿¤Ï " newpath
125 ¤Î¥Ç¥£¥ì¥¯¥È¥êÉôʬ¤¬¡¢¼ÂºÝ¤Ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¡£
129 ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¡£
132 .IR oldpath " ¤È " newpath
133 ¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤¬¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£
136 ¥Õ¥¡¥¤¥ë¤¬Æɤ߹þ¤ßÀìÍѤΥե¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤¹¤ë¡£
139 .IR oldpath " ¤È " newpath
140 ¤¬Æ±¤¸¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Ê¤¤¡£
141 (Linux ¤Ï 1 ¤Ä¤Î¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òÊ£¿ô¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤Ë
142 ¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤òµö²Ä¤·¤Æ¤¤¤ë¡£
145 ¤Ï¡¢¤¿¤È¤¨Æ±¤¸¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤¢¤Ã¤Æ¤â¡¢
146 ÊÌ¡¹¤Î¥Þ¥¦¥ó¥È°ÌÃÖ¤ò¸Ù¤¤¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¡£)
148 SVr4, 4.3BSD, POSIX.1-2001 (⤷¡ÖÃí°Õ¡×¤ò»²¾È)¡£
149 .\" SVr4 ¤Ï¾¤Ë ENOLINK, EMULTIHOP ¥¨¥é¡¼¾õÂ֤ˤĤ¤¤Æ¤âµ½Ò¤·¤Æ¤¤¤ë¡£
150 .\" POSIX.1 ¤Ë¤Ï ELOOP ¤Ë¤Ä¤¤¤Æ¤Îµ½Ò¤Ï¤Ê¤¤¡£
151 .\" X/OPEN ¤Ë¤Ï EFAULT, ENOMEM, EIO ¤Ë¤Ä¤¤¤Æ¤Îµ½Ò¤Ï¤Ê¤¤¡£
154 ¤Ç¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤òĶ¤¨¤Æ¥Ï¡¼¥É¡¦¥ê¥ó¥¯¤òºîÀ®¤¹¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¡£
161 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢
165 ¤Î»²¾È¤ò²ò·è¤¹¤Ù¤¤Ç¤¢¤ë¤Èµ½Ò¤µ¤ì¤Æ¤¤¤ë¡£
166 ¤·¤«¤·¡¢¥«¡¼¥Í¥ë 2.0 °Ê¹ß¤Î
167 .\" Àµ³Î¤Ë¤Ï¥«¡¼¥Í¥ë 1.3.56 °Ê¹ß
168 Linux ¤Ç¤Ï¤½¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£
170 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Ç¤¢¤ë¾ì¹ç¡¢
172 ¤ÏƱ¤¸¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¥Õ¥¡¥¤¥ë¤Ø¤Î (¥Ï¡¼¥É) ¥ê¥ó¥¯¤È¤·¤ÆºîÀ®¤µ¤ì¤ë
177 ¤¬»²¾È¤·¤Æ¤¤¤¿Æ±¤¸¥Õ¥¡¥¤¥ë¤Ø¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤Ê¤ë)¡£
178 ¾¤Î¤¤¤¯¤Ä¤«¤Î¼ÂÁõ¤Ç¤â Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£
179 .\" Î㤨¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤Î Solaris ¤Î¥³¥ó¥Ñ¥¤¥ë´Ä¶¤Ç¤Ï
180 .\" Linux ¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤¹¤ë¡£¤½¤·¤Æ Austin ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î
181 .\" 2005 ǯ 3 ·î¤Î¥¹¥ì¥Ã¥É¤ËÅê¹Æ¤·¤¿¿Í¤¿¤Á¤Ï¡¢
182 .\" ¤½¤Î¾¤Î¤¤¤¯¤Ä¤«¤Î (System V) ¼ÂÁõ¤Ç¤âƱ¤¸¤Ç¤¢¤Ã¤¿/¤¢¤ë¡¢
183 .\" ¤ÈÊó¹ð¤·¤Æ¤¤¤ë -- MTK, Apr 05
188 ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î¾ì¹ç¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î»²¾È¤ò
189 ²ò·è¤¹¤ë¤«¤É¤¦¤«¤Ï¼ÂÁõ°Í¸¤È¤Ê¤Ã¤¿¡£
190 ¥ê¥ó¥¯ºîÀ®»þ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤Î°·¤¤¤Ë¤Ä¤¤¤Æ¤Î¾ÜºÙ¤ÊÀ©¸æ¤Ë
195 NFS ¥Õ¥¡¥¤¥ë¡¦¥·¥¹¥Æ¥à¤Ç¤Ï¡¢NFS ¥µ¡¼¥Ð¡¼¤¬¥ê¥ó¥¯¤òºîÀ®¤·¤¿¸å¤Ë¡¢
196 ¤½¤ì¤òÅÁ¤¨¤ëÁ°¤Ë»à¤ó¤À¾ì¹ç¤Ë¤ÏÊÖ¤êÃͤ¬ÉÔÀµ¤Ê¾ì¹ç¤¬¤¢¤ë¡£
197 ¥ê¥ó¥¯¤¬ºîÀ®¤Ç¤¤¿¤«¤É¤¦¤«¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï
208 .BR path_resolution (7),