diff options
| author | Roy Marples <roy@marples.name> | 2012-11-10 16:38:53 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2012-11-10 16:38:53 +0000 |
| commit | 34a7563e0f74f55355e106cd6715c4a0d23ccd97 (patch) | |
| tree | 6d303558d67bc59ada42e1fc419e6e256cb4e4e9 /configure | |
| parent | 5c08c0c4cad951fb3727efde4f1e314df68e7d91 (diff) | |
| download | dhcpcd-34a7563e0f74f55355e106cd6715c4a0d23ccd97.tar.xz | |
Add a pselect(2) shim for systems that lack support for it.
When building, warn that it's not entirely race condition safe.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -50,6 +50,8 @@ for x do --without-closefrom) CLOSEFROM=no;; --without-getline) GETLINE=no;; --without-strlcpy) STRLCPY=no;; + --without-posix_spawn) POSIX_SPAWN=no;; + --without-pselect) PSELECT=no;; --serviceexists) SERVICEEXISTS=$var;; --servicecmd) SERVICECMD=$var;; --servicestatus) SERVICESTATUS=$var;; @@ -437,6 +439,29 @@ else echo "#include <spawn.h>" >>$CONFIG_H fi +if [ -z "$PSELECT" ]; then + printf "Testing for pselect ... " + cat <<EOF >_pselect.c +#include <sys/select.h> +#include <stdlib.h> +int main(void) { + pselect(0, NULL, NULL, NULL, NULL, NULL); + return 0; +} +EOF + if $XCC _pselect.c -o _pselect 2>/dev/null; then + PSELECT=yes + else + PSELECT=no + fi + echo "$PSELECT" + rm -f _pselect.c _pselect +fi +if [ "$PSELECT" = no ]; then + echo "COMPAT_SRCS+= compat/pselect.c" >>$CONFIG_MK + echo "#include \"compat/pselect.h\"" >>$CONFIG_H +fi + if [ -z "$SERVICECMD" ]; then printf "Checking for OpenRC ... " if [ -x /sbin/rc-service ]; then |
