1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
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 <faith@cs.unc.edu>
27 .\" Modified 1996-09-08 by Arnt Gulbrandsen <agulbra@troll.no>
28 .\" Modified 1997-01-31 by Eric S. Raymond <esr@thyrsus.com>
29 .\" Modified 2001-05-17 by aeb
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:42:31 JST 1997
35 .\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
36 .\" Modified Tue Sep 5 02:03:33 JST 2000
37 .\" by Yuichi SATO <ysato@h4.dion.ne.jp>
38 .\" Modified Sat Jun 2 08:48:36 JST 2001 by Yuichi SATO
39 .\" Modified Sun Jul 7 02:58:51 JST 2002 by Yuichi SATO
40 .\" Updated & Modified Sun Jan 9 23:28:11 JST 2005
41 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
43 .\"WORD: file system ファイルシステム
47 .\"WORD: symbolic link シンボリック・リンク
48 .\"WORD: descriptor ディスクリプター
51 .\"WORD: effective UID 実効ユーザーID
52 .\"WORD: sticky-bit スティッキー・ビット
53 .\"WORD: dangling symbolic link 壊れたシンボリック・リンク
55 .\"WORD: protocol プロトコル
57 .TH UNLINK 2 2004-06-23 "Linux" "Linux Programmer's Manual"
60 .\"O unlink \- delete a name and possibly the file it refers to
61 unlink \- 名前を削除し、場合によってはそれが参照しているファイルも削除する
64 .B #include <unistd.h>
66 .BI "int unlink(const char *" pathname );
70 .\"O deletes a name from the file system.
71 .\"O If that name was the
72 .\"O last link to a file and no processes have the file open the file is
73 .\"O deleted and the space it was using is made available for reuse.
76 もしその名前がファイルへの最後のリンク (link) であり、
77 どのプロセスもそのファイルをオープン (open) していなければ、
79 ファイルが使用していたディスク上の領域は再利用が可能になる。
81 .\"O If the name was the last link to a file but any processes still have
82 .\"O the file open the file will remain in existence until the last file
83 .\"O descriptor referring to it is closed.
84 もし削除する名前がファイルへの最後のリンクだが、どれかのプロセスが
86 そのファイルを参照している最後のファイルディスクリプター (file descriptor)
87 がクローズ (close) されるまでファイルは存在し続ける。
89 .\"O If the name referred to a symbolic link the link is removed.
90 もしその名前がシンボリック・リンク (symbolic link) を参照していれば、
93 .\"O If the name referred to a socket, fifo or device the name for it is
94 .\"O removed but processes which have the object open may continue to use
96 もし名前がソケット (socket) や fifo やデバイス (device) を参照していれば
97 名前は削除されるがそのオブジェクトをオープンしていたプロセスは
99 .\"O .SH "RETURN VALUE"
101 .\"O On success, zero is returned.
102 .\"O On error, \-1 is returned, and
104 .\"O is set appropriately.
105 成功した場合は 0 を返す。エラーならば \-1 を返し、
112 .\"O Write access to the directory containing
114 .\"O is not allowed for the process's effective UID, or one of the
117 .\"O did not allow search permission.
119 .\"O .BR path_resolution (7).)
121 を含んでいるディレクトリの書き込み許可がプロセスの実効 (effective)
124 の中のディレクトリのどれかに検索許可が与えられていない
125 .RB ( path_resolution (7)
128 .\"O .BR EBUSY " (not on Linux)"
129 .BR EBUSY " (Linux 以外)"
132 .\"O cannot be unlinked because it is being used by the system
133 .\"O or another process and the implementation considers this an error.
136 がシステムまたは他のプロセスによって使用されていて
137 リンクが削除できなかったので、この実装ではエラーとした。
141 .\"O points outside your accessible address space.
143 がアクセス可能なアドレス空間の外を指している。
146 .\"O An I/O error occurred.
151 .\"O refers to a directory.
152 .\"O (This is the non-POSIX value returned by Linux since 2.1.132.)
155 (これは POSIX で規定されていない値で、Linux 2.1.132 以降で返される。)
158 .\"O Too many symbolic links were encountered in translating
161 を解決する際に遭遇したシンボリック・リンクが多過ぎる。
164 .\"O .IR pathname " was too long."
165 .IR pathname " が長過ぎる。"
170 .\"O does not exist or is a dangling symbolic link, or
174 に対応するものが存在しないか、壊れたシンボリック・リンクであるか、
179 .\"O Insufficient kernel memory was available.
180 十分なカーネル (kernel) のメモリーが使用できない。
183 .\"O A component used as a directory in
185 .\"O is not, in fact, a directory.
187 のディレクトリ部分が、実際には、ディレクトリでない。
190 .\"O The system does not allow unlinking of directories,
191 .\"O or unlinking of directories requires privileges that the
192 .\"O calling process doesn't have.
193 .\"O (This is the POSIX prescribed error return;
194 .\"O as noted above, Linux returns
197 システムがディレクトリに対する unlink 操作を許可していない。
198 またはディレクトリに対する unlink 操作のために必要な特権を
200 (これは POSIX で規定されているエラーの返し方である。
205 .\"O .BR EPERM " (Linux only)"
206 .BR EPERM " (Linux のみ)"
207 .\"O The file system does not allow unlinking of files.
208 ファイルシステムがファイルに対する unlink 操作を許していない。
210 .\"O .BR EPERM " or " EACCES
211 .BR EPERM " または " EACCES
212 .\"O The directory containing
214 .\"O has the sticky-bit
216 .\"O set and the process's effective UID is neither the UID of the file to
217 .\"O be deleted nor that of the directory containing it, and
218 .\"O the process is not privileged (Linux: does not have the
222 を含んでいるディレクトリにスティッキー・ビット (sticky-bit)
224 が設定されていて、プロセスの実効ユーザー ID が削除しようとするファイルの
225 UID でもそれを含んでいるディレクトリのものでもなく、
226 かつプロセスに特権がない (Linux では
228 ケーパビリティ (capability) がない)。
232 .\"O refers to a file on a read-only file system.
234 が読み込み専用のファイルシステムのファイルを参照している。
235 .\"O .SH "CONFORMING TO"
237 SVr4, 4.3BSD, POSIX.1-2001.
238 .\"O .\" SVr4 documents additional error
239 .\"O .\" conditions EINTR, EMULTIHOP, ETXTBSY, ENOLINK.
240 .\" SVr4 には他に EINTR, EMULTIHOP, ETXTBSY, ENOLINK エラーについての
244 .\"O Infelicities in the protocol underlying NFS can cause the unexpected
245 .\"O disappearance of files which are still being used.
246 NFS プロトコル (protocol) の潜在的な不良により、
247 まだ使用中のファイルの突然の消滅を引き起こすことがある。
260 .BR path_resolution (7),