[patch] libstdc++/67747 Allocate space for dirent::d_name
Jonathan Wakely
jwakely@redhat.com
Thu Oct 1 23:43:00 GMT 2015
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 7653 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20151001/47b9e80d/attachment.bin>
More information about the Libstdc++
mailing list