remove redundant libc suplements from qcore_unix_p header

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-18 16:50:03 +00:00
parent 34d5041594
commit 308b9f5726

View file

@ -56,26 +56,6 @@
#include <errno.h>
#include <fcntl.h>
struct sockaddr;
#if defined(Q_OS_LINUX) && defined(O_CLOEXEC)
# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 1
QT_BEGIN_NAMESPACE
namespace QtLibcSupplement {
inline int accept4(int, sockaddr *, QT_SOCKLEN_T *, int)
{ errno = ENOSYS; return -1; }
inline int dup3(int, int, int)
{ errno = ENOSYS; return -1; }
inline int pipe2(int [], int )
{ errno = ENOSYS; return -1; }
}
QT_END_NAMESPACE
using namespace QT_PREPEND_NAMESPACE(QtLibcSupplement);
#else
# define QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC 0
#endif
#define EINTR_LOOP(var, cmd) \
do { \
var = cmd; \
@ -179,7 +159,7 @@ static inline int qt_safe_pipe(int pipefd[2], int flags = 0)
#endif
int ret;
#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC)
#if defined(Q_OS_LINUX) && defined(O_CLOEXEC)
// use pipe2
flags |= O_CLOEXEC;
ret = ::pipe2(pipefd, flags); // pipe2 is Linux-specific and is documented not to return EINTR
@ -233,7 +213,7 @@ static inline int qt_safe_dup2(int oldfd, int newfd, int flags = FD_CLOEXEC)
Q_ASSERT(flags == FD_CLOEXEC || flags == 0);
int ret;
#if QT_UNIX_SUPPORTS_THREADSAFE_CLOEXEC && defined(O_CLOEXEC)
#if defined(Q_OS_LINUX) && defined(O_CLOEXEC)
// use dup3
if (flags & FD_CLOEXEC) {
EINTR_LOOP(ret, ::dup3(oldfd, newfd, O_CLOEXEC));