[PATCH] Add renameat2 function [BZ #17662]
Paul Eggert
eggert@cs.ucla.edu
Mon Jul 2 19:58:00 GMT 2018
Joseph Myers wrote:
> We've had complaints in glibc about fallbacks that introduce races (e.g.
> <https://sourceware.org/bugzilla/show_bug.cgi?id=9813> for pselect). Do
> you have reason to believe that this race is somehow different and
> introducing it will never cause problems for users?
"Never" is a pretty strong word, and I don't know that it's true here. I do know
that the uses of Gnulib renameat2 don't have any problems with races that they
wouldn't have with their own fallbacks, and I haven't yet run into a potential
case that would differ from this.
If the requirement is "never", then let's go with another flag
(RENAME_NONATOMIC, say), that can be ORed in to allow renameat2 to behave
non-atomically. This flag would not be passed to the Linux kernel syscall; it
would affect only the user-mode fallback code.
More information about the Libc-alpha
mailing list