directory.3 (has no "RETURN VALUES" section and) fails to
describe the return value of readdir_r().
The diff below adds a sentence about the return value.
It also converts "return (X)" to "return X" in the
sample code.
Ross
Index: directory.3
===================================================================
RCS file: /cvs/src/lib/libc/gen/directory.3,v
retrieving revision 1.24
diff -u -p -r1.24 directory.3
--- directory.3 10 Nov 2015 23:48:18 -0000 1.24
+++ directory.3 13 Sep 2017 10:46:29 -0000
@@ -129,6 +129,8 @@ must be large enough for a dirent with a
array member containing at least
.Dv NAME_MAX
plus one elements.
+.Fn readdir_r
+returns 0 on success, or an error number indicating the error which occurred.
On successful return, the pointer returned at
.Fa "*result"
will have the same value as the argument
@@ -201,11 +203,11 @@ if (dirp) {
if (dp->d_namlen == len &&
!strcmp(dp->d_name, name)) {
(void)closedir(dirp);
- return (FOUND);
+ return FOUND;
}
(void)closedir(dirp);
}
-return (NOT_FOUND);
+return NOT_FOUND;
.Ed
.Sh ERRORS
The