summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2013-11-26 10:22:37 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-28 08:50:28 (GMT)
commit6539f0885fc5f962b9e0e905ff34963aeee3ee6d (patch)
tree45dbfbd8e389abcafd3522f0ba303b3cb0dd8bd3
parent93b819b448d565e293f7564c8a3de86424411101 (diff)
downloadQt-6539f0885fc5f962b9e0e905ff34963aeee3ee6d.zip
Qt-6539f0885fc5f962b9e0e905ff34963aeee3ee6d.tar.gz
Qt-6539f0885fc5f962b9e0e905ff34963aeee3ee6d.tar.bz2
QNX: Make use of _readdir64_r
Latest QNX versions support _readdir64_r. It will be used by QFileSystemIterator now, when available to support large file systems. Backport from qtbase/5d8c05baf478d8eb8cb7ce827caa2c1103f5fa3f Change-Id: I264cc39a0cae6e84ed0db2e10df5ea22c8ae3df4 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
-rw-r--r--mkspecs/common/qnx/qplatformdefs.h7
-rw-r--r--mkspecs/qnx-armv7le-qcc/qplatformdefs.h7
-rw-r--r--mkspecs/qnx-x86-qcc/qplatformdefs.h7
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp4
4 files changed, 23 insertions, 2 deletions
diff --git a/mkspecs/common/qnx/qplatformdefs.h b/mkspecs/common/qnx/qplatformdefs.h
index d797abe..bbcd1ad 100644
--- a/mkspecs/common/qnx/qplatformdefs.h
+++ b/mkspecs/common/qnx/qplatformdefs.h
@@ -74,8 +74,15 @@
#include <arpa/inet.h>
#define QT_USE_XOPEN_LFS_EXTENSIONS
+#if !defined(__EXT_QNX__READDIR64_R)
#define QT_NO_READDIR64
+#endif
#include "../posix/qplatformdefs.h"
+#if defined(__EXT_QNX__READDIR64_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir64_r
+#elif defined(__EXT_QNX__READDIR_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir_r
+#endif
#include <stdlib.h>
diff --git a/mkspecs/qnx-armv7le-qcc/qplatformdefs.h b/mkspecs/qnx-armv7le-qcc/qplatformdefs.h
index 8c4c33c..5ca27e1 100644
--- a/mkspecs/qnx-armv7le-qcc/qplatformdefs.h
+++ b/mkspecs/qnx-armv7le-qcc/qplatformdefs.h
@@ -83,8 +83,15 @@
#include <arpa/inet.h>
#define QT_USE_XOPEN_LFS_EXTENSIONS
+#if !defined(__EXT_QNX__READDIR64_R)
#define QT_NO_READDIR64
+#endif
#include "../common/posix/qplatformdefs.h"
+#if defined(__EXT_QNX__READDIR64_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir64_r
+#elif defined(__EXT_QNX__READDIR_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir_r
+#endif
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
diff --git a/mkspecs/qnx-x86-qcc/qplatformdefs.h b/mkspecs/qnx-x86-qcc/qplatformdefs.h
index 8c4c33c..5ca27e1 100644
--- a/mkspecs/qnx-x86-qcc/qplatformdefs.h
+++ b/mkspecs/qnx-x86-qcc/qplatformdefs.h
@@ -83,8 +83,15 @@
#include <arpa/inet.h>
#define QT_USE_XOPEN_LFS_EXTENSIONS
+#if !defined(__EXT_QNX__READDIR64_R)
#define QT_NO_READDIR64
+#endif
#include "../common/posix/qplatformdefs.h"
+#if defined(__EXT_QNX__READDIR64_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir64_r
+#elif defined(__EXT_QNX__READDIR_R)
+#define QT_EXT_QNX_READDIR_R ::_readdir_r
+#endif
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index bfedd3f..0b59aa1 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -105,8 +105,8 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
if (!dir)
return false;
-#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
- lastError = _readdir_r(dir, mt_file.data(), &dirEntry, direntSize);
+#if defined(Q_OS_QNX) && defined(QT_EXT_QNX_READDIR_R)
+ lastError = QT_EXT_QNX_READDIR_R(dir, mt_file.data(), &dirEntry, direntSize);
if (lastError)
return false;
#elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)