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-24 by Rik Faith
27 .\" Modified 1996-04-26 by Nick Duffek <nsd@bbc.com>
28 .\" Modified 1996-11-06 by Eric S. Raymond <esr@thyrsus.com>
29 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
30 .\" Modified 2004-06-23 by Michael Kerrisk <mtk.manpages@gmail.com>
32 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
33 .\" all rights reserved.
34 .\" Translated Fri Dec 12 00:32:12 JST 1997
35 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Updated & Modifed Sat Feb 12 11:20:18 JST 2005
37 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
39 .\"WORD: symbolic link シンボリック・リンク
40 .\"WORD: directory ディレクトリ
41 .\"WORD: soft link ソフト・リンク
42 .\"WORD: hard link ハード・リンク
43 .\"WORD: dangling link 壊れたリンク
44 .\"WORD: sticky bit スティッキー・ビット
45 .\"WORD: ownership 所有権
46 .\"WORD: file system ファイル・システム
47 .\"WORD: effective uid 実効ユーザーID
51 .TH SYMLINK 2 2010-09-20 "Linux" "Linux Programmer's Manual"
54 .\"O symlink \- make a new name for a file
55 symlink \- ファイルに新しい名前を付ける
58 .B #include <unistd.h>
60 .BI "int symlink(const char *" oldpath ", const char *" newpath );
63 .\"O Feature Test Macro Requirements for glibc (see
64 .\"O .BR feature_test_macros (7)):
66 .RB ( feature_test_macros (7)
73 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
74 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\ >=\ 200112L
80 .\"O creates a symbolic link named
82 .\"O which contains the string
89 というシンボリック・リンク (symbolic link) を作成する。
91 .\"O Symbolic links are interpreted at run time as if the contents of the
92 .\"O link had been substituted into the path being followed to find a file or
95 リンクの内容でパスを置き換えて、そのパスを辿ることで、
98 .\"O Symbolic links may contain
100 .\"O path components, which (if used at the start of the link) refer to the
101 .\"O parent directories of that in which the link resides.
104 を含むかもしれない。これは (もしリンクの最初に使用された場合は) リンクの
105 存在するディレクトリの親ディレクトリが参照される。
107 .\"O A symbolic link (also known as a soft link) may point to an existing
108 .\"O file or to a nonexistent one; the latter case is known as a dangling
110 シンボリック・リンクは (ソフト・リンク (soft link) とも呼ばれ)
111 存在するファイルを指しているかもしれないし、
112 存在しないファイルを指しているかもしれない;
113 後者の場合は壊れたリンク (dangling link) とも呼ばれる。
115 .\"O The permissions of a symbolic link are irrelevant; the ownership is
116 .\"O ignored when following the link, but is checked when removal or
117 .\"O renaming of the link is requested and the link is in a directory with
121 シンボリック・リンクの許可 (permission) は無意味である;
122 リンクを追跡する場合には所有権 (ownership) は無視される。
123 ただし、リンクの削除や名前の変更が要求され、かつリンクが存在する
124 ディレクトリにスティッキー・ビット (sticky bit)
126 が設定されている場合には、所有権のチェックが行われる。
134 が既に存在する場合には上書きは\fBされない\fR。
135 .\"O .SH "RETURN VALUE"
137 .\"O On success, zero is returned.
138 .\"O On error, \-1 is returned, and
140 .\"O is set appropriately.
141 成功した場合には 0 を返す。エラーの場合には \-1 を返し、
148 .\"O Write access to the directory containing
150 .\"O is denied, or one of the directories in the path prefix of
152 .\"O did not allow search permission.
154 .\"O .BR path_resolution (7).)
156 を含んでいるディレクトリへの書き込みが拒否されたか、
158 に含まれているディレクトリのどれかに検索許可が与えられていない
159 .RB ( path_resolution (7)
169 .\"O .IR oldpath " or " newpath " points outside your accessible address space."
170 .IR oldpath " や " newpath " がアクセス可能なアドレス空間の外を指している。"
173 .\"O An I/O error occurred.
177 .\"O Too many symbolic links were encountered in resolving
180 を解決する際に遭遇したシンボリック・リンクが多過ぎる。
183 .\"O .IR oldpath " or " newpath " was too long."
184 .IR oldpath " または " newpath " が長過ぎる。"
187 .\"O A directory component in
189 .\"O does not exist or is a dangling symbolic link, or
191 .\"O is the empty string.
193 に含まれるディレクトリ部分が存在しないか、壊れたリンクであるか、
198 .\"O Insufficient kernel memory was available.
199 十分なカーネル (kernel) のメモリーがない。
202 .\"O The device containing the file has no room for the new directory
204 ファイルが含まれているデバイスに新しいディレクトリ・エントリ
205 (directory entry) を作成するだけの十分な容量がない。
208 .\"O A component used as a directory in
210 .\"O is not, in fact, a directory.
212 に含まれるディレクトリ部分が、実際には、ディレクトリではない。
215 .\"O The file system containing
217 .\"O does not support the creation of symbolic links.
219 を含んでいるファイル・システム (file system) が
220 シンボリック・リンクの作成をサポートしていない。
224 .\"O is on a read-only file system.
226 が読み込み専用のファイル・システムに存在している。
227 .\"O .SH "CONFORMING TO"
229 SVr4, 4.3BSD, POSIX.1-2001.
230 .\"O .\" SVr4 documents additional error codes EDQUOT and ENOSYS.
231 .\" SVr4 には他に EDQUOT, ENOSYS エラーについての記述がある。
233 .\"O .\" .BR open (2)
234 .\"O .\" re multiple files with the same name, and NFS.
236 .\" を見て、同じ名前の重複と NFS について参照すること。
245 .\"O Deleting the name referred to by a symlink will actually delete the
246 .\"O file (unless it also has other hard links).
247 .\"O If this behavior is not desired, use
249 symlink によって参照される名前を削除すると (それが他にハード・リンク
250 (hard link) を持たなければ) 実際にファイルが削除される。
265 .BR path_resolution (7),