dnl CF_FCNTL_VS_IOCTL version: 5 updated: 2022/12/06 16:25:27
dnl -----------------
dnl Test if we have a usable ioctl with FIONREAD, or if fcntl.h is preferred.
AC_DEFUN([CF_FCNTL_VS_IOCTL],
[
AC_MSG_CHECKING(if we may use FIONREAD)
AC_CACHE_VAL(cf_cv_use_fionread,[
	AC_TRY_COMPILE([
#if HAVE_SYS_FILIO_H
#  include <sys/filio.h>	/* FIONREAD (BSDs) */
#endif
#if HAVE_SYS_IOCTL_H
#  include <sys/ioctl.h>	/* FIONREAD (other...) */
#endif
	],[
int l1;
ioctl (0, FIONREAD, &l1);
	],
	[cf_cv_use_fionread=yes],
	[cf_cv_use_fionread=no])
])
AC_MSG_RESULT($cf_cv_use_fionread)
test $cf_cv_use_fionread = yes && AC_DEFINE(USE_FIONREAD,1,[Define to 1 if we may use FIONREAD])
])dnl
