[Boost-bugs] [Boost C++ Libraries] #13172: filesystem::directory_iterator::operator++: Function not implemented (errno not reset)

Subject: [Boost-bugs] [Boost C++ Libraries] #13172: filesystem::directory_iterator::operator++: Function not implemented (errno not reset)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-08-21 18:32:24


#13172: filesystem::directory_iterator::operator++: Function not implemented (errno
not reset)
-------------------------------------------------+-------------------------
 Reporter: Simon Warta <simon@…> | Owner: Beman Dawes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.64.0 | Severity: Problem
 Keywords: filesystem, errno, sysconf, |
  readdir, Android |
-------------------------------------------------+-------------------------
 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

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13172>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-08-21 18:39:03 UTC