66f4766c6b
RENAME_NO_REPLACE is a neat flag for renameat2 which disallows renaming a source onto an existing target. I originally implemented this flag in relibc, but that code is still subject to TOCTOU because the sequence of checking if the target exists and the actual rename isn't atomic. The code for the flag isn't used anywhere yet, like frename, but it's unit tested and works for now.