OSDN Git Service

(split) LDP: Update original to LDP v3.63
[linuxjm/LDP_man-pages.git] / original / man2 / close.2
index 975841b..6432c3f 100644 (file)
 .\"   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 Nicolás 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.
 .\"
-.TH CLOSE 2 2007-12-28 "Linux" "Linux Programmer's Manual"
+.TH CLOSE 2 2013-12-30 "Linux" "Linux Programmer's Manual"
 .SH NAME
 close \- close a file descriptor
 .SH SYNOPSIS
@@ -98,6 +98,12 @@ Not checking the return value when closing the file may lead to
 silent loss of data.
 This can especially be observed with NFS
 and with disk quota.
+Note that the return value should only be used for diagnostics.
+In particular
+.BR close ()
+should not be retried after an
+.B EINTR
+since this may cause a reused descriptor from another thread to be closed.
 .PP
 A successful close does not guarantee that the data has been successfully
 saved to disk, as the kernel defers writes.
@@ -119,7 +125,7 @@ that may cause unintended side effects.
 .\" One such race involves signals and ERESTARTSYS. If a file descriptor
 .\" in use by a system call is closed and then reused by e.g. an
 .\" independent open() in some unrelated thread, before the original system
-.\" call has restared after ERESTARTSYS, the original system call will
+.\" call has restarted after ERESTARTSYS, the original system call will
 .\" later restart with the reused file descriptor. This is most likely a
 .\" serious programming error.
 .SH SEE ALSO