OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man2 / close.2
index dc55c6b..6fc86b8 100644 (file)
@@ -1,8 +1,7 @@
-.\" Hey Emacs! This file is -*- nroff -*- source.
-.\"
 .\" This manpage is Copyright (C) 1992 Drew Eckhardt;
-.\"                               1993 Michael Haardt, Ian Jackson.
+.\"             and Copyright (C) 1993 Michael Haardt, Ian Jackson.
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -22,6 +21,7 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
 .\" Modified Wed Jul 21 22:40:25 1993 by Rik Faith <faith@cs.unc.edu>
 .\" Modified Sat Feb 18 15:27:48 1995 by Michael Haardt
 .\"   corrected description of effect on locks (thanks to
 .\"   Tigran Aivazian <tigran@sco.com>).
 .\" Modified Fri Jan 31 16:21:46 1997 by Eric S. Raymond <esr@thyrsus.com>
-.\" Modified 2000-07-22 by Nicolas Lichtmaier <nick@debian.org>
+.\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
 .\"   added note about close(2) not guaranteeing that data is safe on close.
 .\"
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.\"
 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
 .\"         all rights reserved.
 .\" Translated Sat Jun  1 22:22:05 JST 1997
 .\" Updated 2007-10-12, Akihiro MOTOKI, LDP v2.66
 .\" Updated 2008-02-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
 .\"
-.\"WORD:       descriptor              ディスクリプタ
-.\"WORD:       close                   クローズ
-.\"WORD:       lock                    ロック
-.\"WORD:       process                 プロセス
-.\"WORD:       quota                   クォータ
-.\"
-.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual"
-.\"O .SH NAME
+.TH CLOSE 2 2007\-12\-28 Linux "Linux Programmer's Manual"
 .SH 名前
-.\"O close \- close a file descriptor
 close \- ファイルディスクリプタをクローズする
-.\"O .SH SYNOPSIS
 .SH 書式
 .nf
-.B #include <unistd.h>
+\fB#include <unistd.h>\fP
 .sp
-.BI "int close(int " fd );
+\fBint close(int \fP\fIfd\fP\fB);\fP
 .fi
-.\"O .SH DESCRIPTION
 .SH 説明
-.\"O .BR close ()
-.\"O closes a file descriptor, so that it no longer refers to any file and
-.\"O may be reused. Any record locks (see
-.\"O .BR fcntl (2))
-.\"O held on the file it was associated with,
-.\"O and owned by the process, are removed (regardless of the file
-.\"O descriptor that was used to obtain the lock).
-.BR close ()
-は、ファイルディスクリプタをクローズする。
-そのディスクリプタは、どのファイルも参照していない状態になり、
-再利用が可能になる。
-そのファイルディスクリプタに関連づけられたファイルに
-かけられたレコード・ロック
-.RB ( fcntl (2)
-参照) のうち、そのプロセスが保有しているものは、
-(そのファイルディスクリプタがロック取得に利用されたか
-どうかによらず) すべて削除される。
+\fBclose\fP()  は、ファイルディスクリプタをクローズする。 そのディスクリプタは、どのファイルも参照していない状態になり、 再利用が可能になる。
+そのファイルディスクリプタに関連づけられたファイルに かけられたレコード・ロック (\fBfcntl\fP(2)  参照)
+のうち、そのプロセスが保有しているものは、 (そのファイルディスクリプタがロック取得に利用されたか どうかによらず) すべて削除される。
 .PP
-.\"O If
-.\"O .I fd
-.\"O is the last file descriptor referring to the underlying
-.\"O open file description (see
-.\"O .BR open (2)),
-.\"O the resources associated with the open file description are freed;
-.\"O if the descriptor was the last reference to a file which has been
-.\"O removed using
-.\"O .BR unlink (2)
-.\"O the file is deleted.
-.I fd
-が、対応するオープンファイル記述 (open file description)
-.RB ( open (2)
-参照) を参照する最後のファイルディスクリプタだった場合、
-オープンファイル記述に関連するリソースが解放される。
-そのディスクリプタが、
-.B unlink
-を使用して削除 (remove) されたファイルに対する最後の参照だった場合には、
-そのファイルは削除 (delete) される。
-.\"O .SH "RETURN VALUE"
+\fIfd\fP が、対応するオープンファイル記述 (open file description)  (\fBopen\fP(2)  参照)
+を参照する最後のファイルディスクリプタだった場合、 オープンファイル記述に関連するリソースが解放される。 そのディスクリプタが、 \fBunlink\fP
+を使用して削除 (remove) されたファイルに対する最後の参照だった場合には、 そのファイルは削除 (delete) される。
 .SH 返り値
-.\"O .BR close ()
-.\"O returns zero on success.
-.\"O On error, \-1 is returned, and
-.\"O .I errno
-.\"O is set appropriately.
-.BR close ()
-は成功した場合は 0 を返す。
-エラーが発生した場合は \-1 を返して、
-.I errno
-を適切に設定する。
-.\"O .SH ERRORS
+\fBclose\fP()  は成功した場合は 0 を返す。 エラーが発生した場合は \-1 を返して、 \fIerrno\fP を適切に設定する。
 .SH エラー
-.TP
-.B EBADF
-.\"O .I fd
-.\"O isn't a valid open file descriptor.
-.I fd
-が有効なオープンされたディスクリプタでない。
-.TP
-.B EINTR
-.\"O The
-.\"O .BR close ()
-.\"O call was interrupted by a signal; see
-.\"O .BR signal (7).
-.BR close ()
-コールがシグナルにより中断 (interrupt) された。
-.BR signal (7)
-参照。
-.TP
-.B EIO
-.\"O An I/O error occurred.
+.TP 
+\fBEBADF\fP
+\fIfd\fP が有効なオープンされたディスクリプタでない。
+.TP 
+\fBEINTR\fP
+\fBclose\fP()  コールがシグナルにより中断 (interrupt) された。 \fBsignal\fP(7)  参照。
+.TP 
+\fBEIO\fP
 I/O エラーが発生した。
-.\"O .SH "CONFORMING TO"
 .SH 準拠
-.\"O SVr4, 4.3BSD, POSIX.1-2001.
-.\"O .\" SVr4 documents an additional ENOLINK error condition.
-SVr4, 4.3BSD, POSIX.1-2001.
-.\" SVr4, SVID, POSIX, X/OPEN, 4.3BSD に準拠する。
-.\" SVr4 には他に ENOLINK エラー状態についての記述がある。
-.\"O .SH "NOTES"
+.\" SVr4 documents an additional ENOLINK error condition.
+SVr4, 4.3BSD, POSIX.1\-2001.
 .SH 注意
-.\"O Not checking the return value of
-.\"O .BR close ()
-.\"O is a common but nevertheless
-.\"O serious programming error.
-.\"O It is quite possible that errors on a
-.\"O previous
-.\"O .BR write (2)
-.\"O operation are first reported at the final
-.\"O .BR close ().
-.\"O Not checking the return value when closing the file may lead to
-.\"O silent loss of data.
-.\"O This can especially be observed with NFS
-.\"O and with disk quota.
-.BR close ()
-の返り値のチェックはよく省略されるが、
-これは深刻なプログラミングエラーである。
-前の
-.BR write (2)
-処理に関するエラーが最後の
-.BR close ()
-のときになって初めて通知される場合がありうる。
-ファイルクローズの際に返り値をチェックしないと、
-気付かないうちにデータを失ってしまうかもしれない。
-これは特に NFS やディスク・クォータを使用した場合に見られる。
+\fBclose\fP()  の返り値のチェックはよく省略されるが、 これは深刻なプログラミングエラーである。 前の \fBwrite\fP(2)
+処理に関するエラーが最後の \fBclose\fP()  のときになって初めて通知される場合がありうる。 ファイルクローズの際に返り値をチェックしないと、
+気付かないうちにデータを失ってしまうかもしれない。 これは特に NFS やディスク・クォータを使用した場合に見られる。
 .PP
-.\"O A successful close does not guarantee that the data has been successfully
-.\"O saved to disk, as the kernel defers writes.
-.\"O Is not common for a file system
-.\"O to flush the buffers when the stream is closed.
-.\"O If you need to be sure that
-.\"O the data is physically stored use
-.\"O .BR fsync (2).
-.\"O (It will depend on the disk hardware at this point.)
-クローズに成功しても、データがディスクに保存されたかどうかは
-保証されない (カーネルが書きこみを遅延させることがあるためである)。
-ストリームがクローズされるときにバッファをフラッシュするかどうかは、
-ファイルシステムによって異なる。
-データが物理的に保存されることを保証する必要がある場合には、
-.BR fsync (2)
-を使用すること
-.RB ( fsync (3)
-を行った時点で、データの保存はディスクのハードウェアに依存する
-問題となる)。
+クローズに成功しても、データがディスクに保存されたかどうかは 保証されない (カーネルが書きこみを遅延させることがあるためである)。
+ストリームがクローズされるときにバッファをフラッシュするかどうかは、 ファイルシステムによって異なる。
+データが物理的に保存されることを保証する必要がある場合には、 \fBfsync\fP(2)  を使用すること (\fBfsync\fP(3)
+を行った時点で、データの保存はディスクのハードウェアに依存する 問題となる)。
 .PP
-.\"O It is probably unwise to close file descriptors while
-.\"O they may be in use by system calls in
-.\"O other threads in the same process.
-.\"O Since a file descriptor may be reused,
-.\"O there are some obscure race conditions
-.\"O that may cause unintended side effects.
-同じプロセス内の他のスレッドのシステムコールが使用している可能性がある間に、
-ファイルディスクリプタをクローズするのは、おそらく賢明ではないだろう。
-ファイルディスクリプタは再利用されるかもしれないので、
-あいまいな競合条件となることがあり、意図しない副作用の原因となりうる。
 .\" Date: Tue, 4 Sep 2007 13:57:35 +0200
 .\" From: Fredrik Noring <noring@nocrew.org>
 .\" One such race involves signals and ERESTARTSYS. If a file descriptor
@@ -208,11 +102,12 @@ SVr4, 4.3BSD, POSIX.1-2001.
 .\" call has restared after ERESTARTSYS, the original system call will
 .\" later restart with the reused file descriptor. This is most likely a
 .\" serious programming error.
-.\"O .SH "SEE ALSO"
+同じプロセス内の他のスレッドのシステムコールが使用している可能性がある間に、 ファイルディスクリプタをクローズするのは、おそらく賢明ではないだろう。
+ファイルディスクリプタは再利用されるかもしれないので、 あいまいな競合条件となることがあり、意図しない副作用の原因となりうる。
 .SH 関連項目
-.BR fcntl (2),
-.BR fsync (2),
-.BR open (2),
-.BR shutdown (2),
-.BR unlink (2),
-.BR fclose (3)
+\fBfcntl\fP(2), \fBfsync\fP(2), \fBopen\fP(2), \fBshutdown\fP(2), \fBunlink\fP(2),
+\fBfclose\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。