[filesystem] Now uses POSIX readdir_r if available

CVS has been updated: * For POSIX systems, directory_iterator now uses readdir_r if available, with a fallback to readdir otherwise. The POSIX readdir function uses a static buffer, so is unsafe in multi-threaded apps. Furthermore, there has been a report that readdir on Mac OS X does not meet the POSIX requirement of a different static buffer for each directory stream; readdir_r should solve that problem too. * Tests have been added to operations_test.cpp to detect interference between directory_iterators. The changes have been tested using operations_test.cpp on Red Hat Linux 8.0 and Windows XP. Since gcc on this Linux does supply readdir_r, the code was tweaked by hand to force use of readdir. Both passed. Please let me know right away if you run into any problems! --Beman
participants (1)
-
Beman Dawes