From 2a834d39a69430058df3916392afab064ca941ee Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 7 Jul 2009 13:48:03 +0200 Subject: try to fix the accept4 not being found in some older kernels --- src/corelib/kernel/qcore_unix.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 2549f77..b04abae 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -138,22 +138,32 @@ static inline int syscall(...) { errno = ENOSYS; return -1;} # define __NR_dup3 330 # define __NR_pipe2 331 # elif defined(__x86_64__) -# define __NR_accept4 288 # define __NR_dup3 292 # define __NR_pipe2 293 # elif defined(__ia64__) -# define __NR_accept4 -1 # define __NR_dup3 1316 # define __NR_pipe2 1317 # else // set the syscalls to absurd numbers so that they'll cause ENOSYS errors -# warning "Please port the pipe2/dup3/accept4 code to this platform" -# define __NR_accept4 -1 +# warning "Please port the pipe2/dup3 code to this platform" # define __NR_dup3 -1 # define __NR_pipe2 -1 # endif # endif +# if !defined(__NR_socketcall) && !defined(__NR_accept4) +# if defined(__x86_64__) +# define __NR_accept4 288 +# elif defined(__ia64__) +// not assigned yet to IA-64 +# define __NR_accept4 -1 +# else +// set the syscalls to absurd numbers so that they'll cause ENOSYS errors +# warning "Please port the accept4 code to this platform" +# define __NR_accept4 -1 +# endif +# endif + QT_BEGIN_NAMESPACE namespace QtLibcSupplement { int pipe2(int pipes[], int flags) -- cgit v0.12