From 70e8940332049ba65e2e8a1a90293b65c4048bcb Mon Sep 17 00:00:00 2001 From: Joseph Koshy Date: Wed, 3 Jun 1998 06:54:24 +0000 Subject: Correct wrong claim about `telldir()' cookie lifetimes. PR: 4043 Submitted by: Joe Orthoefer --- lib/libc/gen/directory.3 | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3 index 0abbe5fc6192..a1ca34774020 100644 --- a/lib/libc/gen/directory.3 +++ b/lib/libc/gen/directory.3 @@ -94,6 +94,16 @@ The function returns the current location associated with the named .Em directory stream . +Values returned by +.Fn telldir +are good only for the lifetime of the +.Dv DIR +pointer, +.Fa dirp , +from which they are derived. If the directory is closed and then +reopened, prior values returned by +.Fn telldir +will no longer be valid. .Pp The .Fn seekdir @@ -106,22 +116,7 @@ The new position reverts to the one associated with the .Em directory stream when the .Fn telldir -operation was performed. Values returned by -.Fn telldir -are good only for the lifetime of the -.Dv DIR -pointer, -.Fa dirp , -from which they are derived. -If the directory is closed and then reopened, the -.Fn telldir -value may be invalidated due to undetected directory compaction. -It is safe to use a previous -.Fn telldir -value immediately after a call to -.Fn opendir -and before any calls to -.Fn readdir . +operation was performed. .Pp The .Fn rewinddir -- cgit v1.3