OSDN Git Service

11b49fdbf5fbd2f239c52291cb7210d8565b1715
[linuxjm/LDP_man-pages.git] / release / man2 / symlink.2
1 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
2 .\"             and Copyright (C) 1993 Michael Haardt, Ian Jackson.
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
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 .\" %%%LICENSE_END
25 .\"
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>
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" This file was generated with po4a. Translate the source file.
35 .\"
36 .\"*******************************************************************
37 .\"
38 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
39 .\"         all rights reserved.
40 .\" Translated Fri Dec 12 00:32:12 JST 1997
41 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
42 .\" Updated & Modifed Sat Feb 12 11:20:18 JST 2005
43 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
44 .\" Updated 2013-05-06, Akihiro MOTOKI <amotoki@gmail.com>
45 .\"
46 .TH SYMLINK 2 2013\-01\-27 Linux "Linux Programmer's Manual"
47 .SH 名前
48 symlink \- ファイルに新しい名前を付ける
49 .SH 書式
50 \fB#include <unistd.h>\fP
51 .sp
52 \fBint symlink(const char *\fP\fIoldpath\fP\fB, const char *\fP\fInewpath\fP\fB);\fP
53 .sp
54 .in -4n
55 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
56 .in
57 .sp
58 .ad l
59 \fBsymlink\fP():
60 .RS 4
61 _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 500 || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE\ >=\ 200112L
62 .RE
63 .ad b
64 .SH 説明
65 \fBsymlink\fP()  は \fIoldpath\fP という文字列をファイルの内容として持つ \fInewpath\fP というシンボリックリンク
66 (symbolic link) を作成する。
67
68 シンボリックリンクは実行時に解釈され、 リンクの内容でパスを置き換えて、そのパスを辿ることで、 ファイルやディレクトリに到達する。
69
70 シンボリックリンクはパスの部分に \fI..\fP を含むかもしれない。これは (もしリンクの最初に使用された場合は) リンクの
71 存在するディレクトリの親ディレクトリが参照される。
72
73 シンボリックリンクは (ソフトリンク (soft link) とも呼ばれ)  存在するファイルを指しているかもしれないし、
74 存在しないファイルを指しているかもしれない; 後者の場合は壊れたリンク (dangling link) とも呼ばれる。
75
76 シンボリックリンクの許可 (permission) は無意味である; リンクを追跡する場合には所有権 (ownership) は無視される。
77 ただし、リンクの削除や名前の変更が要求され、かつリンクが存在する ディレクトリにスティッキービット (sticky bit)  (\fBS_ISVTX\fP)
78 が設定されている場合には、所有権のチェックが行われる。
79
80 \fInewpath\fP が存在する場合には上書きは\fIされない\fP。
81 .SH 返り値
82 成功した場合は 0 が返される。エラーの場合は \-1 が返され、 \fIerrno\fP が適切に設定される。
83 .SH エラー
84 .TP 
85 \fBEACCES\fP
86 \fInewpath\fP を含んでいるディレクトリへの書き込みが拒否されたか、 \fInewpath\fP
87 に含まれているディレクトリのどれかに検索許可が与えられていない (\fBpath_resolution\fP(7)  も参照すること)。
88 .TP 
89 \fBEDQUOT\fP
90 The user's quota of resources on the filesystem has been exhausted.  The
91 resources could be inodes or disk blocks, depending on the filesystem
92 implementation.
93 .TP 
94 \fBEEXIST\fP
95 \fInewpath\fP が既に存在する。
96 .TP 
97 \fBEFAULT\fP
98 \fIoldpath\fP や \fInewpath\fP がアクセス可能なアドレス空間の外を指している。
99 .TP 
100 \fBEIO\fP
101 I/O エラーが発生した。
102 .TP 
103 \fBELOOP\fP
104 \fInewpath\fP を解決する際に遭遇したシンボリックリンクが多過ぎる。
105 .TP 
106 \fBENAMETOOLONG\fP
107 \fIoldpath\fP または \fInewpath\fP が長過ぎる。
108 .TP 
109 \fBENOENT\fP
110 \fInewpath\fP に含まれるディレクトリ部分が存在しないか、壊れたリンクであるか、 \fIoldpath\fP が空文字列である。
111 .TP 
112 \fBENOMEM\fP
113 十分なカーネルメモリーがない。
114 .TP 
115 \fBENOSPC\fP
116 そのファイルを含んでいるデバイスに新しいディレクトリエントリを 作成するための空きがない。
117 .TP 
118 \fBENOTDIR\fP
119 \fInewpath\fP に含まれるディレクトリ部分が、実際には、ディレクトリではない。
120 .TP 
121 \fBEPERM\fP
122 The filesystem containing \fInewpath\fP does not support the creation of
123 symbolic links.
124 .TP 
125 \fBEROFS\fP
126 \fInewpath\fP is on a read\-only filesystem.
127 .SH 準拠
128 .\" SVr4 documents additional error codes EDQUOT and ENOSYS.
129 .\" See
130 .\" .BR open (2)
131 .\" re multiple files with the same name, and NFS.
132 SVr4, 4.3BSD, POSIX.1\-2001.
133 .SH 注意
134 \fIoldpath\fP についてのチェックは行なわれない。
135
136 symlink によって参照される名前を削除すると (それが他にハードリンク (hard link) を持たなければ) 実際にファイルが削除される。
137 この動作が望んだものでない場合は、 \fBlink\fP(2)  を使用すること。
138 .SH 関連項目
139 \fBln\fP(1), \fBlchown\fP(2), \fBlink\fP(2), \fBlstat\fP(2), \fBopen\fP(2), \fBreadlink\fP(2),
140 \fBrename\fP(2), \fBsymlinkat\fP(2), \fBunlink\fP(2), \fBpath_resolution\fP(7),
141 \fBsymlink\fP(7)
142 .SH この文書について
143 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
144 である。プロジェクトの説明とバグ報告に関する情報は
145 http://www.kernel.org/doc/man\-pages/ に書かれている。