Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162083660
D7678.id19767.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D7678.id19767.diff
View Options
Index: lib/libc/gen/directory.3
===================================================================
--- lib/libc/gen/directory.3
+++ lib/libc/gen/directory.3
@@ -28,7 +28,7 @@
.\" @(#)directory.3 8.1 (Berkeley) 6/4/93
.\" $FreeBSD$
.\"
-.Dd February 19, 2016
+.Dd August 28, 2016
.Dt DIRECTORY 3
.Os
.Sh NAME
@@ -68,6 +68,15 @@
.Ft int
.Fn dirfd "DIR *dirp"
.Sh DESCRIPTION
+.Bf -symbolic
+The interface
+.Fn readdir_r
+is deprecated
+because it cannot be used correctly if
+.Brq Va NAME_MAX
+is not fixed.
+.Ef
+.Pp
The
.Fn opendir
function
@@ -122,7 +131,13 @@
.Fn readdir
function
returns a pointer to the next directory entry.
-It returns
+The directory entry remains valid until the next call to
+.Fn readdir
+or
+.Fn closedir
+on the same
+.Em directory stream .
+The function returns
.Dv NULL
upon reaching the end of the directory or on error.
In the event of an error,
@@ -139,6 +154,13 @@
but the caller must provide a directory
.Fa entry
buffer to store the results in.
+The buffer must be large enough for a
+.Vt struct dirent
+with a
+.Va d_name
+array of
+.Brq Va NAME_MAX
++ 1 bytes long.
If the read succeeds,
.Fa result
is pointed at the
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 10, 2:15 PM (11 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34931154
Default Alt Text
D7678.id19767.diff (1 KB)
Attached To
Mode
D7678: directory(3): Deprecate readdir_r(). Clarify dirent buffers.
Attached
Detach File
Event Timeline
Log In to Comment