diff options
Diffstat (limited to 'ja_JP.eucJP/man/man2/unlink.2')
-rw-r--r-- | ja_JP.eucJP/man/man2/unlink.2 | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/ja_JP.eucJP/man/man2/unlink.2 b/ja_JP.eucJP/man/man2/unlink.2 new file mode 100644 index 0000000000..92d8f6fa51 --- /dev/null +++ b/ja_JP.eucJP/man/man2/unlink.2 @@ -0,0 +1,113 @@ +.\" Copyright (c) 1980, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 +.\" %FreeBSD: src/lib/libc/sys/unlink.2,v 1.7.2.1 1999/08/29 14:49:29 peter Exp % +.\" +.Dd June 4, 1993 +.Dt UNLINK 2 +.Os BSD 4 +.Sh 名称 +.Nm unlink +.Nd ディレクトリエントリの削除 +.Sh 書式 +.Fd #include <unistd.h> +.Ft int +.Fn unlink "const char *path" +.Sh 解説 +.Fn unlink +関数は、 +.Fa path +で指定されたリンクをディレクトリから削除し、 +そのリンクで参照されていたファイルのリンク数を減らします。 +ファイルのリンク数が 0 になり、ファイルを開いているプロセスがなくなると、 +ファイルに関連するすべてのリソースが再生されます。 +最後のリンクが削除されたときに、ファイルを開いているプロセスが +1 つ以上あると、リンクは削除されますが、ファイルの削除は、 +そのファイルへのすべての参照が閉じられるまで延期されます。 +.Fa path +は、ディレクトリでない場合もあります。 +.Sh 戻り値 +処理が正常に完了すると、値 0 が返されます。 +そうでない場合は -1 が返され、エラーを示すために +.Va errno +が設定されます。 +.Sh エラー +.Fn unlink +は、以下の場合に処理を失敗します。 +.Bl -tag -width ENAMETOOLONGAA +.It Bq Er ENOTDIR +パスの構成要素中にディレクトリ以外のものが含まれています。 +.It Bq Er ENAMETOOLONG +パス名の構成要素が 255 文字を越えているか、 +またはパス名全体が 1023 文字を越えています。 +.It Bq Er ENOENT +指定されたファイルが存在しません。 +.It Bq Er EACCES +前置パス名の構成要素について検索許可が拒否されています。 +.It Bq Er EACCES +削除するリンクを含むディレクトリで、書込み許可が拒否されています。 +.It Bq Er ELOOP +パス名を変換するときに検出されたシンボリックリンクが多すぎます。 +.It Bq Er EPERM +指定されたファイルがディレクトリになっています。 +.It Bq Er EPERM +ファイルを含むディレクトリがスティッキーとマークされ、 +削除するファイルを含むディレクトリまたはファイルが、 +有効なユーザ ID に所有されていません。 +.It Bq Er EBUSY +リンクを削除するエントリが、 +マウント済みファイルシステムのマウントポイントです。 +.It Bq Er EIO +ディレクトリエントリの削除中か、inode の割当て解除中に +入出力エラーが発生しました。 +.It Bq Er EROFS +指定されたファイルは読取り専用ファイルシステム上にあります。 +.It Bq Er EFAULT +.Fa path +は、プロセスに割り当てられたアドレス空間の範囲外を指しています。 +.El +.Sh 関連項目 +.Xr close 2 , +.Xr link 2 , +.Xr rmdir 2 , +.Xr symlink 7 +.Sh 歴史 +.Fn unlink +関数呼出しは、 +.At v6 +で登場しました。 +.Pp +古来の +.Fn unlink +システムコールでは、ファイルシステムを破壊する可能性のあるディレクトリの +リンクをスーパユーザが削除できるようになっています。 +それを実行することは、すでに許可されなくなっています。 |