diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-15 01:00:11 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-15 01:00:11 +0100 |
commit | 8264e495fa9220c101a8a913701a0b8834a6d58b (patch) | |
tree | 069aa1d3efab926991c1edfc5b69a3d9e58dcfba /src/corelib/io/qfilesystemengine_unix.cpp | |
parent | 80f52812f2651e6d427bb3dd2e338b60fb25d48b (diff) | |
parent | 8eb3944dac81b8c51d7bac7784204d457551b50c (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
Diffstat (limited to 'src/corelib/io/qfilesystemengine_unix.cpp')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 2a42ad42f9..5cc3a5937e 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -91,26 +91,35 @@ extern "C" NSString *NSTemporaryDirectory(); # include <sys/syscall.h> # include <sys/sendfile.h> # include <linux/fs.h> +# include <linux/stat.h> // in case linux/fs.h is too old and doesn't define it: #ifndef FICLONE # define FICLONE _IOW(0x94, 9, int) #endif -# if !QT_CONFIG(renameat2) && defined(SYS_renameat2) +# if defined(Q_OS_ANDROID) +// renameat2() and statx() are disabled on Android because quite a few systems +// come with sandboxes that kill applications that make system calls outside a +// whitelist and several Android vendors can't be bothered to update the list. +# undef SYS_renameat2 +# undef SYS_statx +# undef STATX_BASIC_STATS +# else +# if !QT_CONFIG(renameat2) && defined(SYS_renameat2) static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newpath, unsigned flags) { return syscall(SYS_renameat2, oldfd, oldpath, newfd, newpath, flags); } -# endif +# endif -# if !QT_CONFIG(statx) && defined(SYS_statx) && QT_HAS_INCLUDE(<linux/stat.h>) -# include <linux/stat.h> +# if !QT_CONFIG(statx) && defined(SYS_statx) static int statx(int dirfd, const char *pathname, int flag, unsigned mask, struct statx *statxbuf) { return syscall(SYS_statx, dirfd, pathname, flag, mask, statxbuf); } -# endif +# endif +# endif // !Q_OS_ANDROID #endif -#ifndef STATX_BASIC_STATS -struct statx { mode_t stx_mode; }; +#ifndef STATX_ALL +struct statx { mode_t stx_mode; }; // dummy #endif QT_BEGIN_NAMESPACE |