summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-15 14:01:34 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-15 14:02:01 (GMT)
commit41ce7d3be0c4560d5f4ef0187e3e6916149e5d49 (patch)
tree60440cc5307ba5a265c103cb6d47441384b402a3
parent234cb624f5dcfc80133843b20e840d1c386082df (diff)
downloadQt-41ce7d3be0c4560d5f4ef0187e3e6916149e5d49.zip
Qt-41ce7d3be0c4560d5f4ef0187e3e6916149e5d49.tar.gz
Qt-41ce7d3be0c4560d5f4ef0187e3e6916149e5d49.tar.bz2
Restore the use of threadsafe-fdcloexec calls on weird Linux toolchains.
Approach suggested by Rohan on 1866485e46039d51ea78a6d672b678aa02f68eef
-rw-r--r--src/corelib/kernel/qcore_unix_p.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h
index 8d43897..dd97841 100644
--- a/src/corelib/kernel/qcore_unix_p.h
+++ b/src/corelib/kernel/qcore_unix_p.h
@@ -69,10 +69,27 @@
struct sockaddr;
-#if defined(Q_OS_LINUX) && defined(O_CLOEXEC) && defined(__GLIBC__) && (__GLIBC__ * 0x100 + __GLIBC_MINOR__) >= 0x0204
+#if defined(Q_OS_LINUX) && defined(__GLIBC__) && (__GLIBC__ * 0x100 + __GLIBC_MINOR__) >= 0x0204
// Linux supports thread-safe FD_CLOEXEC
# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 1
+// add defines for the consts for Linux
+# ifndef O_CLOEXEC
+# define O_CLOEXEC 02000000
+# endif
+# ifndef FD_DUPFD_CLOEXEC
+# define F_DUPFD_CLOEXEC 1030
+# endif
+# ifndef SOCK_CLOEXEC
+# define SOCK_CLOEXEC O_CLOEXEC
+# endif
+# ifndef SOCK_NONBLOCK
+# define SOCK_NONBLOCK O_NONBLOCK
+# endif
+# ifndef MSG_CMSG_CLOEXEC
+# define MSG_CMSG_CLOEXEC 0x40000000
+# endif
+
QT_BEGIN_NAMESPACE
namespace QtLibcSupplement {
Q_CORE_EXPORT int accept4(int, sockaddr *, QT_SOCKLEN_T *, int flags);