diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-29 14:27:48 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-08-04 17:30:33 +0000 |
commit | 88c30618d512864adab0733b58dd5f48b7f98f74 (patch) | |
tree | 0c28e9d39de9bb0a2076fc83e9f3501c1b2c9587 /src/corelib/global/qconfig-bootstrapped.h | |
parent | 4934138be29868bdf848e2aeb6c6163819ab3a5c (diff) |
QFileSystemEngine::renameFile: use calls that don't overwrite
The renameat2(2) Linux system call, new in 3.16, allows for the atomic
renaming of a file if and only if it won't clobber an existing
file. None of the Linux libcs have enabled this syscall as an API, so we
use syscall(3) to place the call.
If your libc has SYS_renameat2 but your kernel doesn't support it, we'll
keep issuing the unknown syscall, every time. Users in that situation
should upgrade (3.16 is from 2014).
On Darwin, there's a similar renameatx_np (guessing "np" stands for
"non-portable"). I haven't found anything similar on the other BSDs.
Change-Id: I1eba2b016de74620bfc8fffd14ccb4e455a3ec9e
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib/global/qconfig-bootstrapped.h')
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 398da739e1..f1b99609ce 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -88,6 +88,7 @@ #define QT_NO_QOBJECT #define QT_FEATURE_process -1 #define QT_NO_SYSTEMLOCALE +#define QT_FEATURE_renameat2 -1 #define QT_FEATURE_slog2 -1 #define QT_FEATURE_syslog -1 #define QT_FEATURE_temporaryfile 1 |