This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add renameat2 function [BZ #17662]
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Carlos O'Donell <carlos at redhat dot com>, Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 4 Jul 2018 12:53:43 -0700
- Subject: Re: [PATCH] Add renameat2 function [BZ #17662]
- References: <20180630121447.E4C8643994575@oldenburg.str.redhat.com> <6917cf4b-a8bb-a0c8-f600-bb286554854a@redhat.com>
Carlos O'Donell wrote:
Suggest something like this:
* The library now implements the renameat2 function. On Linux systems that
support the renameat2 system call this is a wrapper for the kernel support
and avoids the race conditions present with renameat. No emulation is provide
and if renameat2 is not supported by the underlying operating system either
an errno of ENOSYS or EINVAL error will be returned.
This wording doesn't look right, since there is emulation in some cases even
when renameat2 is not supported by the underlying operating system. That is,
when FLAGS == 0, renameat2 is often emulated via renameat. How about something
like this wording instead?
* The library now implements the renameat2 function. On Linux systems that
support the renameat2 system call this is a wrapper for kernel support
and when renameat2's flags are nonzero this should avoid race conditions
present with renameat. The renameat2 function fails with an errno of
ENOSYS or EINVAL when given nonzero flags that cannot be implemented
atomically by the kernel.