summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnet_unix_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/socket/qnet_unix_p.h')
-rw-r--r--src/network/socket/qnet_unix_p.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/network/socket/qnet_unix_p.h b/src/network/socket/qnet_unix_p.h
index 03ed3b4c9..f38c2fcfa 100644
--- a/src/network/socket/qnet_unix_p.h
+++ b/src/network/socket/qnet_unix_p.h
@@ -59,11 +59,18 @@
#include <sys/socket.h>
#include <netinet/in.h>
+#if defined(Q_OS_VXWORKS)
+# include <sockLib.h>
+#endif
+
// for inet_addr
#include <netdb.h>
#include <arpa/inet.h>
-#include <resolv.h>
-
+#if defined(Q_OS_VXWORKS)
+# include <hostLib.h>
+#else
+# include <resolv.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -155,17 +162,28 @@ static inline int qt_safe_connect(int sockfd, const struct sockaddr *addr, QT_SO
# undef listen
#endif
+// VxWorks' headers specify 'int' instead of '...' for the 3rd ioctl() parameter.
template <typename T>
static inline int qt_safe_ioctl(int sockfd, int request, T arg)
{
+#ifdef Q_OS_VXWORKS
+ return ::ioctl(sockfd, request, (int) arg);
+#else
return ::ioctl(sockfd, request, arg);
+#endif
}
+// VxWorks' headers do not specify any const modifiers
static inline in_addr_t qt_safe_inet_addr(const char *cp)
{
+#ifdef Q_OS_VXWORKS
+ return ::inet_addr((char *) cp);
+#else
return ::inet_addr(cp);
+#endif
}
+// VxWorks' headers do not specify any const modifiers
static inline int qt_safe_sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *to, QT_SOCKLEN_T tolen)
{
#ifdef MSG_NOSIGNAL
@@ -173,7 +191,11 @@ static inline int qt_safe_sendto(int sockfd, const void *buf, size_t len, int fl
#endif
register int ret;
+#ifdef Q_OS_VXWORKS
+ EINTR_LOOP(ret, ::sendto(sockfd, (char *) buf, len, flags, (struct sockaddr *) to, tolen));
+#else
EINTR_LOOP(ret, ::sendto(sockfd, buf, len, flags, to, tolen));
+#endif
return ret;
}