From 189e9c93d7ed42202ad51507c8944d64e9a7888d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 28 Jun 2017 23:36:19 -0700 Subject: QTemporaryFile: Add support for Linux's O_TMPFILE That means a file is never created, unless you ask for the name. There's no chance of left-over temporary files being left behind. QSaveFile also benefits from this, since the save file is not present on disk until commit(). Unfortunately, QSaveFile must go through a temporary name because linkat(2) cannot overwrite -- we need rename(2) for that (for now). [ChangeLog][Important Behavior Changes][QTemporaryFile] On Linux, QTemporaryFile will attempt to create unnamed temporary files. If that succeeds, open() will return true but exists() will be false. If you call fileName() or any function that calls it, QTemporaryFile will give the file a name, so most applications will not see a difference. Change-Id: I1eba2b016de74620bfc8fffd14cc843e5b0919d0 Reviewed-by: Simon Hausmann --- src/corelib/global/minimum-linux.S | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/minimum-linux.S b/src/corelib/global/minimum-linux.S index aa67be44ca..6b7fb4f63b 100644 --- a/src/corelib/global/minimum-linux.S +++ b/src/corelib/global/minimum-linux.S @@ -81,6 +81,7 @@ * Feature Added in version Macro * - inotify_init1 before 2.6.12-rc12 * - futex(2) before 2.6.12-rc12 + * - linkat(2) 2.6.17 O_TMPFILE * - FUTEX_PRIVATE_FLAG 2.6.22 * - O_CLOEXEC 2.6.23 * - eventfd 2.6.23 -- cgit v1.2.3