2 dnl # Linux 6.5 removes register_sysctl_table
4 AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE], [
5 ZFS_LINUX_TEST_SRC([has_register_sysctl_table], [
6 #include <linux/sysctl.h>
8 static struct ctl_table dummy_table[] = {
13 struct ctl_table_header *h
14 __attribute((unused)) = register_sysctl_table(dummy_table);
18 AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE], [
19 AC_MSG_CHECKING([whether register_sysctl_table exists])
20 ZFS_LINUX_TEST_RESULT([has_register_sysctl_table], [
22 AC_DEFINE(HAVE_REGISTER_SYSCTL_TABLE, 1,
23 [register_sysctl_table exists])
30 dnl # Linux 6.11 register_sysctl() enforces that sysctl tables no longer
31 dnl # supply a sentinel end-of-table element. 6.6 introduces
32 dnl # register_sysctl_sz() to enable callers to choose, so we use it if
33 dnl # available for backward compatibility.
35 AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ], [
36 ZFS_LINUX_TEST_SRC([has_register_sysctl_sz], [
37 #include <linux/sysctl.h>
39 struct ctl_table test_table[] __attribute__((unused)) = {0};
40 register_sysctl_sz("", test_table, 0);
44 AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ], [
45 AC_MSG_CHECKING([whether register_sysctl_sz exists])
46 ZFS_LINUX_TEST_RESULT([has_register_sysctl_sz], [
48 AC_DEFINE(HAVE_REGISTER_SYSCTL_SZ, 1,
49 [register_sysctl_sz exists])
56 dnl # Linux 6.11 makes const the ctl_table arg of proc_handler
58 AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST], [
59 ZFS_LINUX_TEST_SRC([has_proc_handler_ctl_table_const], [
60 #include <linux/sysctl.h>
62 static int test_handler(
63 const struct ctl_table *ctl __attribute((unused)),
64 int write __attribute((unused)),
65 void *buffer __attribute((unused)),
66 size_t *lenp __attribute((unused)),
67 loff_t *ppos __attribute((unused)))
72 proc_handler *ph __attribute((unused)) =
77 AC_DEFUN([ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST], [
78 AC_MSG_CHECKING([whether proc_handler ctl_table arg is const])
79 ZFS_LINUX_TEST_RESULT([has_proc_handler_ctl_table_const], [
81 AC_DEFINE(HAVE_PROC_HANDLER_CTL_TABLE_CONST, 1,
82 [proc_handler ctl_table arg is const])