summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2021-01-30 01:37:15 +0000
committerRoy Marples <roy@marples.name>2021-01-30 01:37:15 +0000
commitd747ef075ce1c9795f0a6975a1e74672166d5b21 (patch)
treeaaaf9499f16c96e1c8f49b7011bdf68d65cfe90a /configure
parente11849f8e2d0d93bd02fac9f296e3c99ff102e32 (diff)
downloaddhcpcd-d747ef075ce1c9795f0a6975a1e74672166d5b21.tar.xz
eloop: Default to using ppoll(2) again.
Even though we now have fully working kqueue(2) and epoll(7) with our privsep code, ppoll(2) is faster and smaller for our workload. This time though, we will keep the code here as it's fully working and while fixing kqueue we also fixed other bugs in dhcpcd as a result so it's not time wasted at all.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure58
1 files changed, 3 insertions, 55 deletions
diff --git a/configure b/configure
index 091815ab..07360a52 100755
--- a/configure
+++ b/configure
@@ -1221,61 +1221,9 @@ fi
# Set this for eloop
echo "#define HAVE_REALLOCARRAY" >>$CONFIG_H
-if [ -z "$POLL" ]; then
- printf "Testing for kqueue1 ... "
- cat <<EOF >_kqueue1.c
-#include <sys/event.h>
-#include <sys/fcntl.h>
-#include <sys/time.h>
-int main(void) {
- return kqueue1(O_CLOEXEC);
-}
-EOF
- if $XCC _kqueue1.c -o _kqueue1 2>&3; then
- POLL=kqueue1
- echo "yes"
- else
- echo "no"
- fi
- rm -f _kqueue1.c _kqueue1
-fi
-
-if [ -z "$POLL" ]; then
- printf "Testing for kqueue ... "
- cat <<EOF >_kqueue.c
-#include <sys/types.h>
-#include <sys/event.h>
-#include <sys/time.h>
-int main(void) {
- return kqueue();
-}
-EOF
- if $XCC _kqueue.c -o _kqueue 2>&3; then
- POLL=kqueue
- echo "yes"
- else
- echo "no"
- fi
- rm -f _kqueue.c _kqueue
-fi
-
-if [ -z "$POLL" ]; then
- printf "Testing for epoll ... "
- cat <<EOF >_epoll.c
-#include <sys/epoll.h>
-int main(void) {
- return epoll_create1(EPOLL_CLOEXEC);
-}
-EOF
- if $XCC _epoll.c -o _epoll 2>&3; then
- POLL=epoll
- echo "yes"
- else
- echo "no"
- fi
- rm -f _epoll.c _epoll
-fi
-
+# Detect a polling mechanism.
+# See src/eloop.c as to why we only detect ppoll, pollts and pselect and
+# not others like epoll or kqueue.
if [ -z "$POLL" ]; then
printf "Testing for ppoll ... "
cat <<EOF >_ppoll.c