Clarify closedir()'s treatment of underlying file descriptor.

At the end of the paragraph in opendir(3) describing fdopendir(), I
think it's worth adding "The file descriptor will be closed when
closedir() is called."  It's a bit ambiguous if the file descriptor
is closed or "given back" at closedir time.

(I've tested this and verified that it's true, BTW.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
George Spelvin 2008-09-23 08:55:50 +02:00 committed by Michael Kerrisk
parent 6dea120e68
commit 7134d7e62c
2 changed files with 10 additions and 1 deletions

View File

@ -10,6 +10,7 @@ The following people contributed notes, ideas, or patches that have
been incorporated in changes in this release:
André Goddard Rosa <andre.goddard@gmail.com>
George Spelvin <linux@horizon.com>
Sam Varshavchik <mrsam@courier-mta.com>
John Reiser <jreiser@bitwagon.com>
@ -56,6 +57,10 @@ timerfd_create.2
Sam Varshavchik
s/it_interval/it_value/ when talking about TIMERFD_ABSTIME.
closedir.3
George Spelvin
Clarify closedir()'s treatment of underlying file descriptor.
tsearch.3
André Goddard Rosa
Fix memory leak in example program.

View File

@ -26,7 +26,7 @@
.\" 386BSD man pages
.\" Modified Sat Jul 24 21:25:52 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 11 June 1995 by Andries Brouwer (aeb@cwi.nl)
.TH CLOSEDIR 3 1995-06-11 "" "Linux Programmer's Manual"
.TH CLOSEDIR 3 2008-09-23 "" "Linux Programmer's Manual"
.SH NAME
closedir \- close a directory
.SH SYNOPSIS
@ -42,6 +42,10 @@ The
.BR closedir ()
function closes the directory stream associated with
\fIdirp\fP.
A successful call to
.BR closedir ()
also closes the underlying file descripotr associated with
.IR dirp .
The directory stream descriptor \fIdirp\fP is not available
after this call.
.SH "RETURN VALUE"