diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/configure.json | 15 | ||||
-rw-r--r-- | src/corelib/global/minimum-linux_p.h | 2 | ||||
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 5 | ||||
-rw-r--r-- | src/corelib/io/qtemporaryfile_p.h | 2 |
4 files changed, 22 insertions, 2 deletions
diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 8067ca70f1..bf44f2649d 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -349,6 +349,15 @@ "qmake": "linux: LIBS += -lpthread -lrt" } }, + "linkat": { + "label": "linkat()", + "type": "compile", + "test": { + "head": "#define _ATFILE_SOURCE 1", + "include": [ "fcntl.h", "unistd.h" ], + "main": "linkat(AT_FDCWD, \"foo\", AT_FDCWD, \"bar\", AT_SYMLINK_FOLLOW);" + } + }, "ppoll": { "label": "ppoll()", "type": "compile", @@ -540,6 +549,12 @@ "condition": "libs.journald", "output": [ "privateFeature" ] }, + "linkat": { + "label": "linkat()", + "autoDetect": "config.linux", + "condition": "tests.linkat", + "output": [ "privateFeature" ] + }, "std-atomic64": { "label": "64 bit atomic operations", "condition": "libs.libatomic", diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h index 324744b856..bad2488b4d 100644 --- a/src/corelib/global/minimum-linux_p.h +++ b/src/corelib/global/minimum-linux_p.h @@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE * - inotify_init1 before 2.6.12-rc12 * - futex(2) before 2.6.12-rc12 * - FUTEX_WAKE_OP 2.6.14 FUTEX_OP - * - linkat(2) 2.6.17 O_TMPFILE + * - linkat(2) 2.6.17 O_TMPFILE && QT_CONFIG(linkat) * - FUTEX_PRIVATE_FLAG 2.6.22 * - O_CLOEXEC 2.6.23 * - eventfd 2.6.23 diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 2164d7f21f..dabb715607 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -87,6 +87,11 @@ #define QT_FEATURE_futimens -1 #define QT_FEATURE_futimes -1 #define QT_FEATURE_library -1 +#ifdef __linux__ +# define QT_FEATURE_linkat 1 +#else +# define QT_FEATURE_linkat -1 +#endif #define QT_NO_QOBJECT #define QT_FEATURE_process -1 #define QT_FEATURE_renameat2 -1 diff --git a/src/corelib/io/qtemporaryfile_p.h b/src/corelib/io/qtemporaryfile_p.h index 46a0d7aba3..f74e5680b9 100644 --- a/src/corelib/io/qtemporaryfile_p.h +++ b/src/corelib/io/qtemporaryfile_p.h @@ -58,7 +58,7 @@ #include "private/qfile_p.h" #include "qtemporaryfile.h" -#ifdef Q_OS_LINUX +#if defined(Q_OS_LINUX) && QT_CONFIG(linkat) # include <fcntl.h> # ifdef O_TMPFILE // some early libc support had the wrong values for O_TMPFILE |