diff --git a/configure b/configure index 845b096..95f0e97 100755 --- a/configure +++ b/configure @@ -655,6 +655,20 @@ then fi fi +if ! test_code 'O_NOFOLLOW flag' 'sys/types.h sys/stat.h fcntl.h' '' "$LIBS" \ + 'return open("/dev/null", O_NOFOLLOW);' +then + if test_code 'O_NOFOLLOW flag with _GNU_SOURCE' 'sys/types.h sys/stat.h fcntl.h' \ + '-D_GNU_SOURCE' "$LIBS" \ + 'return open("/dev/null", O_NOFOLLOW);' + then + add_def _GNU_SOURCE + else + echo "error: open() does not support O_NOFOLLOW flag" + exit 1 + fi +fi + if [ $try_clock_gettime = "1" ]; then if test_code 'clock_gettime()' 'time.h' '' '' \ 'clock_gettime(CLOCK_REALTIME, NULL);'