18#include <QtNetwork/private/qtnetworkglobal_p.h>
19#include "private/qcore_unix_p.h"
22#include <sys/socket.h>
23#include <netinet/in.h>
25#if defined(Q_OS_VXWORKS)
32#if defined(Q_OS_VXWORKS)
41#if !defined(QT_SOCKOPTLEN_T)
42# define QT_SOCKOPTLEN_T QT_SOCKLEN_T
50#ifdef QT_THREADSAFE_CLOEXEC
51 int newtype =
type | SOCK_CLOEXEC;
52 if (
flags & O_NONBLOCK)
53 newtype |= SOCK_NONBLOCK;
61 ::fcntl(
fd, F_SETFD, FD_CLOEXEC);
64 if (
flags & O_NONBLOCK)
65 ::fcntl(
fd, F_SETFL, ::fcntl(
fd, F_GETFL) | O_NONBLOCK);
76#ifdef QT_THREADSAFE_CLOEXEC
78 int sockflags = SOCK_CLOEXEC;
79 if (
flags & O_NONBLOCK)
80 sockflags |= SOCK_NONBLOCK;
81# if defined(Q_OS_NETBSD)
82 fd = ::paccept(
s,
addr,
static_cast<QT_SOCKLEN_T *
>(addrlen), NULL, sockflags);
84 fd = ::accept4(
s,
addr,
static_cast<QT_SOCKLEN_T *
>(addrlen), sockflags);
88 fd = ::accept(
s,
addr,
static_cast<QT_SOCKLEN_T *
>(addrlen));
92 ::fcntl(
fd, F_SETFD, FD_CLOEXEC);
95 if (
flags & O_NONBLOCK)
96 ::fcntl(
fd, F_SETFL, ::fcntl(
fd, F_GETFL) | O_NONBLOCK);
104 return ::listen(
s, backlog);
114#undef QT_SOCKET_CONNECT
115#define QT_SOCKET_CONNECT qt_safe_connect
141 flags |= MSG_NOSIGNAL;
Combined button and popup list for selecting options.
#define EINTR_LOOP(var, cmd)
static int qt_safe_ioctl(int sockfd, unsigned long request, T arg)
#define QT_SOCKET_CONNECT
static int qt_safe_listen(int s, int backlog)
static int qt_safe_sendmsg(int sockfd, const struct msghdr *msg, int flags)
static int qt_safe_socket(int domain, int type, int protocol, int flags=0)
static int qt_safe_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *addrlen, int flags=0)
static int qt_safe_recvmsg(int sockfd, struct msghdr *msg, int flags)
static int qt_safe_connect(int sockfd, const struct sockaddr *addr, QT_SOCKLEN_T addrlen)
QNetworkRequest request(url)