summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-10 16:09:54 +0100
committerRoy Marples <roy@marples.name>2020-05-10 16:09:54 +0100
commit8ec63e6a621b7f027121a31478450698641b84ba (patch)
treec90effa39a8875fdf93f703bd9174a3d7e59dc77 /configure
parent1608a3170735cc697625b2d472286ba95fc88a91 (diff)
downloaddhcpcd-8ec63e6a621b7f027121a31478450698641b84ba.tar.xz
privsep: Implement pledge(2) support as found on OpenBSD
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure b/configure
index b38fe6c1..98410a8f 100755
--- a/configure
+++ b/configure
@@ -663,6 +663,21 @@ EOF
echo "no"
fi
rm -f _capsicum.c _capsicum
+
+ printf "Testing for pledge ... "
+ cat <<EOF >_pledge.c
+#include <unistd.h>
+int main(void) {
+ return pledge("stdio", NULL);
+}
+EOF
+ if $XCC _pledge.c -o _pledge 2>&3; then
+ echo "yes"
+ echo "#define HAVE_PLEDGE" >>$CONFIG_H
+ else
+ echo "no"
+ fi
+ rm -f _pledge.c _pledge
fi
if [ "$OS" = linux ]; then