https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118733
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The standard is very clear about this: "A file system race is the condition that occurs when multiple threads, processes, or computers interleave access and modification of the same object within a file system. Behavior is undefined if calls to functions provided by subclause 31.12 introduce a file system race."