From 7134d7e62cf2bdb9316f0e2f6319f01f1dc3686c Mon Sep 17 00:00:00 2001 From: George Spelvin Date: Tue, 23 Sep 2008 08:55:50 +0200 Subject: [PATCH] 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 --- Changes | 5 +++++ man3/closedir.3 | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 57321a663..e89a8efd4 100644 --- a/Changes +++ b/Changes @@ -10,6 +10,7 @@ The following people contributed notes, ideas, or patches that have been incorporated in changes in this release: André Goddard Rosa +George Spelvin Sam Varshavchik John Reiser @@ -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. diff --git a/man3/closedir.3 b/man3/closedir.3 index fef2303a3..264a3e961 100644 --- a/man3/closedir.3 +++ b/man3/closedir.3 @@ -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"