1dnl #
2dnl # On certain architectures `__copy_from_user_inatomic`
3dnl # is a GPL exported variable and cannot be used by OpenZFS.
4dnl #
5
6dnl #
7dnl # Checking if `__copy_from_user_inatomic` is available.
8dnl #
9AC_DEFUN([ZFS_AC_KERNEL_SRC___COPY_FROM_USER_INATOMIC], [
10	ZFS_LINUX_TEST_SRC([__copy_from_user_inatomic], [
11		#include <linux/uaccess.h>
12	], [
13		int result __attribute__ ((unused)) = __copy_from_user_inatomic(NULL, NULL, 0);
14	], [], [ZFS_META_LICENSE])
15])
16
17AC_DEFUN([ZFS_AC_KERNEL___COPY_FROM_USER_INATOMIC], [
18	AC_MSG_CHECKING([whether __copy_from_user_inatomic is available])
19	ZFS_LINUX_TEST_RESULT([__copy_from_user_inatomic_license], [
20		AC_MSG_RESULT(yes)
21	], [
22		AC_MSG_RESULT(no)
23		AC_MSG_ERROR([
24	*** The `__copy_from_user_inatomic()` Linux kernel function is
25	*** incompatible with the CDDL license and will prevent the module
26	*** linking stage from succeeding.  OpenZFS cannot be compiled.
27		])
28	])
29])
30