[PATCH] libstdc++: retry removal of dir entries if dir removal fails

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jun 30 08:19:09 UTC 2022



On 30/06/2022 09:52, Alexandre Oliva via Gcc-patches wrote:
> On Jun 27, 2022, Alexandre Oliva<oliva at adacore.com>  wrote:
> 
>> I see two potential ways to avoid this:
> Another possibility occurred to me: seeking back to the entry we're
> about to remove, before removing it.  Then, POSIX-compliant
> implementations will just skip the removed entry and find the next one,
> while RTEMS will find the next entry at the spot where the removed entry
> used to be.
> 
> It is syscall-heavier, and it may invoke O(n^2) behavior for each
> directory in remove_all, since prev_pos is quite likely to always hold
> the initial offset, requiring scanning past more and more removed
> entries after each removal, so I don't submit this formally for
> inclusion, but post it FTR.  I've only confirmed that it solves the
> problem on RTEMS, passing libstdc++ filesystem test, but I haven't
> tested it further.

 From my point of view this is behaviour is an RTEMS bug. Instead of 
adding tweaks for RTEMS, it would be better to report the issues and fix 
them in RTEMS. It could be also a Newlib issue.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list