On 01/10/15 19:38 +0100, Jonathan Wakely wrote: >On 01/10/15 18:23 +0100, Jonathan Wakely wrote: >>+ struct op_delete { >>+ void operator()(void* p) const { ::operator delete(p); } >>+ }; >>+ std::unique_ptr<::dirent*, op_delete> ptr; > >Oops, that should be dirent not dirent* i.e. > > std::unique_ptr<::dirent, op_delete> ptr; > >(Found on AIX, where NAME_MAX isn't defined.) Revised patch fixing that, adjusting native_readdir() to work on AIX where readdir_r returns non-zero at end-of-directory, and following the advice of https://womble.decadent.org.uk/readdir_r-advisory.html by using fpathconf and dirfd. Tested x86_64-dragonfly4.2, powerpc64le-linux and powerpc-aix7.