3 ms·
With O_TMPFILE, you can also write new data, and then automatically replace a file on disk. How? Using "linkat"? That's not automatic.
by Animats 7y ago
With O_TMPFILE, you can also write new data, and then automatically replace a file on disk.
How? Using "linkat"? That's not automatic.
- sargun 7y agorenameat2 is meant to be atomic. From the man page: If newpath already exists, it will be atomically replaced, so that there is no point at which another process attempting to access newpath will find it missing. However, there will probably be a window in which both oldpath and newpath refer to the file being renamed.
- Animats 7y agoYes, that's one of the many workarounds for not having unit files. There are different workarounds in the Windows world, and the Linux workround does not work on some file system types.