summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-03-04 16:40:21 +0000
committerRoy Marples <roy@marples.name>2015-03-04 16:40:21 +0000
commit804d1ead10bc7c120aabf747fbd2b595ca335278 (patch)
tree10ea967453d8dc6ad415c36264c100ba5a7d3663 /configure
parent8c3d363e8bb4954f246af159cb592b4f362a39a8 (diff)
downloaddhcpcd-804d1ead10bc7c120aabf747fbd2b595ca335278.tar.xz
Test for kqueue1 or set O_CLOEXEC on the kqueue fd.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure b/configure
index 7b0ff835..2f88536e 100755
--- a/configure
+++ b/configure
@@ -790,6 +790,22 @@ else
fi
if [ -z "$POLL" ]; then
+ printf "Testing for kqueue1 ... "
+ cat <<EOF >_kqueue.c
+#include <sys/event.h>
+int main(void) {
+ return kqueue1(0);
+}
+EOF
+ if $XCC _kqueue.c -o _kqueue 2>&3; then
+ POLL=kqueue1
+ echo "yes"
+ else
+ echo "no"
+ fi
+ rm -f _kqueue.c _kqueue
+fi
+if [ -z "$POLL" ]; then
printf "Testing for kqueue ... "
cat <<EOF >_kqueue.c
#include <sys/event.h>
@@ -869,6 +885,10 @@ EOF
rm -f _pselect.c _pselect
fi
case "$POLL" in
+kqueue1)
+ echo "#define HAVE_KQUEUE" >>$CONFIG_H
+ echo "#define HAVE_KQUEUE1" >>$CONFIG_H
+ ;;
kqueue)
echo "#define HAVE_KQUEUE" >>$CONFIG_H
;;