docs/127908: [PATCH] readdir(3) error documentation

Matthew D. Fuller fullermd at
Tue Oct 7 01:40:01 UTC 2008

>Number:         127908
>Category:       docs
>Synopsis:       [PATCH] readdir(3) error documentation
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 07 01:40:01 UTC 2008
>Originator:     Matthew D. Fuller
>Release:        FreeBSD 7.0-BETA4 i386
System: FreeBSD 7.0-BETA4 FreeBSD 7.0-BETA4 #0: Sun Dec 9 18:37:58 CST 2007 root at i386

	The manpage for readdir(3) doesn't document the possible error
	returns.  The only mention it makes in fact is misleading, since it
	doesn't describe something that can happen.

	The rest of the functions really should have their errno values
	documented as well, probably with the addition of a ERRORS section to
	the manpage.  But this patch gets one step closer, anyway.


Index: directory.3
RCS file: /usr/cvs/src/lib/libc/gen/directory.3,v
retrieving revision 1.17
diff -u -r1.17 directory.3
--- directory.3	16 Apr 2008 18:59:36 -0000	1.17
+++ directory.3	7 Oct 2008 01:26:30 -0000
@@ -122,9 +122,12 @@
 returns a pointer to the next directory entry.
 It returns
-upon reaching the end of the directory or detecting an invalid
-.Fn seekdir
+upon reaching the end of the directory or on error.
+In the event of an error,
+.Va errno
+may be set to any of the values documented for the
+.Xr getdirentries 2
+system call.
 .Fn readdir_r


More information about the freebsd-doc mailing list