opendir() manpage missing errno info.
state errno settings covering all functions in the manpage.
How-To-Repeat: man opendir(), only the closedir() info states errno settings.
> man opendir(), only the closedir() info states errno settings.
The opendir() implementation in libc calls the following functions or
systems calls that may fail: close(), fcntl(), fstat(), malloc(),
mergesort(), open(), stat(), reallocf().
Should we document the join of all the possible errors these calls may
fail with in opendir()'s manpage?
> email@example.com wrote:
> > man opendir(), only the closedir() info states errno settings.
> The opendir() implementation in libc calls the following functions or
> systems calls that may fail: close(), fcntl(), fstat(), malloc(),
> mergesort(), open(), stat(), reallocf().
> Should we document the join of all the possible errors these calls may
> fail with in opendir()'s manpage?
the manpage should at LEAST state that it sets the
extern "errno", otherwise, it is assumed it doesn't,
and this assumption can easily result in programming
if "errno" is not documented, and thus, not checked
for in a program, "errno" will get trapped by some
other function that does check for it.
all calls that may set "errno" should explicity
say so - so programmers can check for it after
I'll work on adding a proper ERRORS section to opendir(3).
Here's a patch that cleans up some of directory(3).
I've tested the errors and actually encountered a case where you can get
EFAULT returned from stat() since the call just passes along blindly a NULL
argument if you gave that to opendir() as dirname argument. Also attached is a
short-circuit for that case in libc/gen/diropen.c. I think it makes sense to
return ENOENT for that case since it fits the description.
I've also renamed filename to dirname to more accurately reflect what the call
For the wording of the added text I used the SUS texts, since I understand we
have permission to do that nowadays.
This manual page will need further cleanups, most likely resulting in the
splitting of some calls to their own pages to keep the layout sane enough to
Please add a [patch] in front of the PR's synopsis.
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
ã¤ã§ã«ã¼ã³ ã©ã¦ãããã¯ ã´ã¡ã³ ãã« ã¦ã§ã«ã´ã§ã³
http://www.in-nomine.org/ | http://www.rangaku.org/
All conditioned things are impermanent. Work out your own salvation with
Release to wild.