On Tue, Nov 22, 2016, at 03:25 AM, Omar Sandoval wrote:
From: Omar Sandoval <redacted>
One of the most common uses of temporary files is the classic atomic
replacement pattern, i.e.,
- write temporary file
- fsync temporary file
- rename temporary file over real file
- fsync parent directory
Now, we have O_TMPFILE, which gives us a much better way to create
temporary files, but it's not possible to use it for this pattern.
FWIW, I have some userspace code that indeed wants exactly this:
https://github.com/GNOME/libglnx/blob/36396b49ad6636c9959f3dfac5e04d41584b1a92/glnx-fdio.c#L232
So if we add this, I'd presumably change the code to try it and
fall back on EINVAL as usual?