summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorRolland Dudemaine <rolland@ghs.com>2011-02-22 15:27:55 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2011-02-22 15:27:55 (GMT)
commit31d29750e65d5e937f12d1d061f3e41e7453880f (patch)
tree2fa014608132aa875dcd3ee63c6e13b4f3d325a3 /src/corelib/io
parent9ced42aa3351e2f07e3e408adfc3f88ac56a7caf (diff)
downloadQt-31d29750e65d5e937f12d1d061f3e41e7453880f.zip
Qt-31d29750e65d5e937f12d1d061f3e41e7453880f.tar.gz
Qt-31d29750e65d5e937f12d1d061f3e41e7453880f.tar.bz2
Various INTEGRITY fixes
Some smaller adaptation for missing POSIX calls and some build system tweaks for the INTEGRITY RTOS Merge-request: 1101 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/io.pri4
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp8
-rw-r--r--src/corelib/io/qresource.cpp2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index 4d4ae21..2b61192 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -113,3 +113,7 @@ win32 {
LIBS += -lplatformenv
}
}
+integrity {
+ SOURCES += io/qfsfileengine_unix.cpp \
+ io/qfsfileengine_iterator_unix.cpp
+}
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index 62e7c9f..6c03b32 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -1029,7 +1029,11 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
if (openMode & QIODevice::ReadOnly) access |= PROT_READ;
if (openMode & QIODevice::WriteOnly) access |= PROT_WRITE;
+#if defined(Q_OS_INTEGRITY)
+ int pageSize = sysconf(_SC_PAGESIZE);
+#else
int pageSize = getpagesize();
+#endif
int extra = offset % pageSize;
if (quint64(size + extra) > quint64((size_t)-1)) {
@@ -1079,6 +1083,7 @@ uchar *QFSFileEnginePrivate::map(qint64 offset, qint64 size, QFile::MemoryMapFla
bool QFSFileEnginePrivate::unmap(uchar *ptr)
{
+#if !defined(Q_OS_INTEGRITY)
Q_Q(QFSFileEngine);
if (!maps.contains(ptr)) {
q->setError(QFile::PermissionsError, qt_error_string(EACCES));
@@ -1093,6 +1098,9 @@ bool QFSFileEnginePrivate::unmap(uchar *ptr)
}
maps.remove(ptr);
return true;
+#else
+ return false;
+#endif
}
QT_END_NAMESPACE
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 2a9d8ee..0435256 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -928,7 +928,7 @@ public:
}
};
-#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && ! defined (Q_OS_NACL)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN) && !defined (Q_OS_NACL) && !defined(Q_OS_INTEGRITY)
#define QT_USE_MMAP
#endif