aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-27 20:58:43 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-27 20:58:43 +0000
commit27463101f15bee17d2f46642c48a7373bc6c595e (patch)
treed542c7676a0da3b27271b60df27eab23e879368a /configure
parentb8ae75538e8a9db54207e6bf3da484939bb5df7e (diff)
Make compatfd fallback more robust
Be more friendly when signalfd() fails, and also add configure checks to detect that syscall(SYS_signalfd) actually works. malc pointed out that some installs do not have /usr/include/linux headers that are in sync with the glibc headers so why SYS_signalfd is defined, it's #defined to _NR_signalfd which is not defined in the /usr/include/linux header. While this is a distro bug, it doesn't hurt to do a more thorough job in detection. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5334 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure b/configure
index 6a727c0a5a..5030558a45 100755
--- a/configure
+++ b/configure
@@ -110,6 +110,8 @@ curses="yes"
aio="yes"
nptl="yes"
mixemu="no"
+signalfd="no"
+eventfd="no"
# OS specific
targetos=`uname -s`
@@ -901,6 +903,33 @@ EOF
fi
fi
+##########################################
+# signalfd probe
+cat > $TMPC << EOF
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <signal.h>
+int main(void) { return syscall(SYS_signalfd, -1, NULL, _NSIG / 8); }
+EOF
+
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ signalfd=yes
+fi
+
+##########################################
+# eventfd probe
+cat > $TMPC << EOF
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+int main(void) { return syscall(SYS_eventfd, 0); }
+EOF
+
+if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
+ eventfd=yes
+fi
+
# Check if tools are available to build documentation.
if [ -x "`which texi2html 2>/dev/null`" ] && \
[ -x "`which pod2man 2>/dev/null`" ]; then
@@ -1229,6 +1258,12 @@ if test "$aio" = "yes" ; then
echo "#define CONFIG_AIO 1" >> $config_h
echo "CONFIG_AIO=yes" >> $config_mak
fi
+if test "$signalfd" = "yes" ; then
+ echo "#define CONFIG_signalfd 1" >> $config_h
+fi
+if test "$eventfd" = "yes" ; then
+ echo "#define CONFIG_eventfd 1" >> $config_h
+fi
# XXX: suppress that
if [ "$bsd" = "yes" ] ; then