xref: /src/sys/contrib/openzfs/config/kernel-access-ok-type.m4 (revision 8a62a2a5659d1839d8799b4274c04469d7f17c78)
1dnl # SPDX-License-Identifier: CDDL-1.0
2dnl #
3dnl # Linux 5.0: access_ok() drops 'type' parameter:
4dnl #
5dnl # - access_ok(type, addr, size)
6dnl # + access_ok(addr, size)
7dnl #
8AC_DEFUN([ZFS_AC_KERNEL_SRC_ACCESS_OK_TYPE], [
9	ZFS_LINUX_TEST_SRC([access_ok_type], [
10		#include <linux/uaccess.h>
11	],[
12		const void __user __attribute__((unused)) *addr =
13		    (void *) 0xdeadbeef;
14		unsigned long __attribute__((unused)) size = 1;
15		int error __attribute__((unused)) = access_ok(0, addr, size);
16	])
17])
18
19AC_DEFUN([ZFS_AC_KERNEL_ACCESS_OK_TYPE], [
20	AC_MSG_CHECKING([whether access_ok() has 'type' parameter])
21	ZFS_LINUX_TEST_RESULT([access_ok_type], [
22		AC_MSG_RESULT(yes)
23		AC_DEFINE(HAVE_ACCESS_OK_TYPE, 1,
24		    [kernel has access_ok with 'type' parameter])
25	],[
26		AC_MSG_RESULT(no)
27	])
28])
29