musl/src/dirent
Rich Felker b9f7f2e876 fix readdir not to set ENOENT when directory is removed while reading
per POSIX, ENOENT is reserved for invalid stream position; it is an
optional error and would only happen if the application performs
invalid seeks on the underlying file descriptor. however, linux's
getdents syscall also returns ENOENT if the directory was removed
between the time it was opened and the time of the read. we need to
catch this case and remap it to simple end-of-file condition (null
pointer return value like an error, but no change to errno). this
issue reportedly affects GNU make in certain corner cases.

rather than backing up and restoring errno, I've just changed the
syscall to be made in a way that doesn't affect errno (via an inline
syscall rather than a call to the __getdents function). the latter
still exists for the purpose of providing the public getdents alias
which sets errno.
2014-02-25 13:05:38 -05:00
..
__dirent.h refactor headers, especially alltypes.h, and improve C++ ABI compat 2013-07-22 11:22:36 -04:00
__getdents.c global cleanup to use the new syscall interface 2011-03-20 00:16:43 -04:00
alphasort.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
closedir.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
dirfd.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
fdopendir.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
opendir.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
readdir.c fix readdir not to set ENOENT when directory is removed while reading 2014-02-25 13:05:38 -05:00
readdir_r.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
rewinddir.c ditch the priority inheritance locks; use malloc's version of lock 2012-04-24 16:32:23 -04:00
scandir.c include cleanups: remove unused headers and add feature test macros 2013-12-12 05:09:18 +00:00
seekdir.c ditch the priority inheritance locks; use malloc's version of lock 2012-04-24 16:32:23 -04:00
telldir.c initial check-in, version 0.5.0 2011-02-12 00:22:29 -05:00
versionsort.c add (currently stubbed due to stubbed strverscmp) versionsort function 2012-06-13 11:14:38 -04:00