fs/io/FileOutputStream: use O_TMPFILE if available
The Linux feature allows writing new files to an invisible file, and then replace the old file. This preserves the old file if we get interrupted by some event.
This commit is contained in:
@@ -42,6 +42,14 @@ class FileOutputStream final : public OutputStream {
|
||||
int fd;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINKAT
|
||||
/**
|
||||
* Was O_TMPFILE used? If yes, then linkat() must be used to
|
||||
* create a link to this file.
|
||||
*/
|
||||
bool is_tmpfile;
|
||||
#endif
|
||||
|
||||
public:
|
||||
FileOutputStream(Path _path, Error &error);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user