diff --git a/config.h.in b/config.h.in index dd6598aa98..6434b12646 100644 --- a/config.h.in +++ b/config.h.in @@ -159,6 +159,9 @@ /* Define to 1 if you have the `FIPS_mode' function. */ #undef HAVE_FIPS_MODE +/* Define to 1 if you have the `flockfile' function. */ +#undef HAVE_FLOCKFILE + /* Build with GeoIP support */ #undef HAVE_GEOIP @@ -168,6 +171,9 @@ /* Build with GeoIP Country IPv6 support */ #undef HAVE_GEOIP_V6 +/* Define to 1 if you have the `getc_unlocked' function. */ +#undef HAVE_GETC_UNLOCKED + /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE diff --git a/configure b/configure index 851f7203ab..4c97c8c48f 100755 --- a/configure +++ b/configure @@ -15246,6 +15246,22 @@ fi done +# +# flockfile is usually provided by pthreads +# +for ac_func in flockfile getc_unlocked +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + # # Look for sysconf to allow detection of the number of processors. # diff --git a/configure.ac b/configure.ac index 34af113a3f..d090484f7f 100644 --- a/configure.ac +++ b/configure.ac @@ -665,6 +665,11 @@ AC_CHECK_FUNCS([pthread_setaffinity_np cpuset_setaffinity processor_bind sched_s AC_CHECK_FUNCS([pthread_setname_np pthread_set_name_np]) AC_CHECK_HEADERS([pthread_np.h], [], [], [#include ]) +# +# flockfile is usually provided by pthreads +# +AC_CHECK_FUNCS([flockfile getc_unlocked]) + # # Look for sysconf to allow detection of the number of processors. # diff --git a/lib/isc/lex.c b/lib/isc/lex.c index dce944b6ca..ca5fe6d160 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c @@ -433,7 +433,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { if (source->is_file) { stream = source->input; -#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) +#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) c = getc_unlocked(stream); #else c = getc(stream);