rtems: Disable fork feature and fix compilation in corelib/io

RTEMS does not support fork.
RTEMS has LOCK_EX and LOCK_NB defines but does not have flock.

Change-Id: I2b1774435bc972f53596f4163ec410b9d22aca4a
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
This commit is contained in:
Mikhail Svetkin 2018-03-20 14:27:45 +01:00
parent b3c52e8224
commit d7093487a3
3 changed files with 8 additions and 3 deletions

View File

@ -172,7 +172,7 @@ win32 {
io/qlockfile_unix.cpp \ io/qlockfile_unix.cpp \
io/qfilesystemiterator_unix.cpp io/qfilesystemiterator_unix.cpp
!integrity:!uikit { !integrity:!uikit:!rtems {
SOURCES += io/forkfd_qt.cpp SOURCES += io/forkfd_qt.cpp
HEADERS += \ HEADERS += \
../3rdparty/forkfd/forkfd.h ../3rdparty/forkfd/forkfd.h

View File

@ -58,6 +58,11 @@
#include <sys/file.h> // flock #include <sys/file.h> // flock
#endif #endif
#if defined(Q_OS_RTEMS)
# undef LOCK_EX
# undef LOCK_NB
#endif
#include <sys/types.h> // kill #include <sys/types.h> // kill
#include <signal.h> // kill #include <signal.h> // kill
#include <unistd.h> // gethostname #include <unistd.h> // gethostname

View File

@ -812,7 +812,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
valid = true; valid = true;
ready = true; ready = true;
#if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)) #if defined(Q_OS_INTEGRITY) || (defined(Q_OS_BSD4) && !defined(Q_OS_NETBSD)) || defined(Q_OS_RTEMS)
bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize; bytesTotal = statfs_buf.f_blocks * statfs_buf.f_bsize;
bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize; bytesFree = statfs_buf.f_bfree * statfs_buf.f_bsize;
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize; bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_bsize;
@ -822,7 +822,7 @@ void QStorageInfoPrivate::retrieveVolumeInfo()
bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize; bytesAvailable = statfs_buf.f_bavail * statfs_buf.f_frsize;
#endif #endif
blockSize = statfs_buf.f_bsize; blockSize = statfs_buf.f_bsize;
#if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) #if defined(Q_OS_ANDROID) || defined(Q_OS_BSD4) || defined(Q_OS_INTEGRITY) || defined(Q_OS_RTEMS)
#if defined(_STATFS_F_FLAGS) #if defined(_STATFS_F_FLAGS)
readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0; readOnly = (statfs_buf.f_flags & ST_RDONLY) != 0;
#endif #endif