SPL_AC_INIT_UTSNAME
SPL_AC_FDTABLE_HEADER
SPL_AC_FILES_FDTABLE
+ SPL_AC_CLEAR_CLOSE_ON_EXEC
SPL_AC_UACCESS_HEADER
SPL_AC_KMALLOC_NODE
SPL_AC_MONOTONIC_CLOCK
])
])
+dnl #
+dnl # 3.4.0 API change,
+dnl # check whether '__clear_close_on_exec()' exists
+dnl #
+AC_DEFUN([SPL_AC_CLEAR_CLOSE_ON_EXEC], [
+ AC_MSG_CHECKING([whether __clear_close_on_exec() is available])
+ SPL_LINUX_TRY_COMPILE([
+ #include <linux/fdtable.h>
+ ],[
+ struct fdtable *fdt = NULL;
+ int fd = 0;
+
+ __clear_close_on_exec(fd, fdt);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CLEAR_CLOSE_ON_EXEC, 1,
+ [__clear_close_on_exec() is available])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
dnl #
dnl # 2.6.18 API change,
dnl # added linux/uaccess.h
+ { $as_echo "$as_me:$LINENO: checking whether __clear_close_on_exec() is available" >&5
+$as_echo_n "checking whether __clear_close_on_exec() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+ #include <linux/fdtable.h>
+
+int
+main (void)
+{
+
+ struct fdtable *fdt = NULL;
+ int fd = 0;
+
+ __clear_close_on_exec(fd, fdt);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+
+
+ rm -Rf build && mkdir -p build
+ echo "obj-m := conftest.o" >build/Makefile
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CLEAR_CLOSE_ON_EXEC 1
+_ACEOF
+
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+ rm -Rf build
+
+
+
+
{ $as_echo "$as_me:$LINENO: checking whether header linux/uaccess.h exists" >&5
$as_echo_n "checking whether header linux/uaccess.h exists... " >&6; }
+ { $as_echo "$as_me:$LINENO: checking whether __clear_close_on_exec() is available" >&5
+$as_echo_n "checking whether __clear_close_on_exec() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+ #include <linux/fdtable.h>
+
+int
+main (void)
+{
+
+ struct fdtable *fdt = NULL;
+ int fd = 0;
+
+ __clear_close_on_exec(fd, fdt);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+
+
+ rm -Rf build && mkdir -p build
+ echo "obj-m := conftest.o" >build/Makefile
+ if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } >/dev/null && { ac_try='test -s build/conftest.o'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CLEAR_CLOSE_ON_EXEC 1
+_ACEOF
+
+
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+
+ rm -Rf build
+
+
+
+
{ $as_echo "$as_me:$LINENO: checking whether header linux/uaccess.h exists" >&5
$as_echo_n "checking whether header linux/uaccess.h exists... " >&6; }