Opened 5 years ago
Last modified 5 years ago
#13172 new Bugs
filesystem::directory_iterator::operator++: Function not implemented (errno not reset)
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | To Be Determined | Component: | filesystem |
Version: | Boost 1.64.0 | Severity: | Problem |
Keywords: | filesystem, errno, sysconf, readdir, Android | Cc: |
Description
In boost/libs/filesystem/src/operations.cpp
we have readdir_r_simulator
, which throws
exception of type boost::filesystem::filesystem_error: boost::filesystem::directory_iterator::operator++: Function not implemented: "/data/local/tmp/my_existing_path"
This is because errno
is not reset after the ::sysconf(_SC_THREAD_SAFE_FUNCTIONS)
call, which sets errno to 38 = ENOSYS.
A patch is to add the line errno = 0; after ::sysconf(_SC_THREAD_SAFE_FUNCTIONS)
.
This affects Android, e.g. https://github.com/android-ndk/ndk/issues/457
Change History (2)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
i can confirm this also affects android ndk r16 when using clang w/ libc++
the mentioned fix solves it ;) thanks!
The diff of the fix is here: https://gist.github.com/webmaster128/5912a70d100e9ef341df67b177c465d6