1dnl # SPDX-License-Identifier: CDDL-1.0 2dnl # 3dnl # Linux 6.5 removes register_sysctl_table 4dnl # 5AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_TABLE], [ 6 ZFS_LINUX_TEST_SRC([has_register_sysctl_table], [ 7 #include <linux/sysctl.h> 8 9 static struct ctl_table dummy_table[] = { 10 {} 11 }; 12 13 ],[ 14 struct ctl_table_header *h 15 __attribute((unused)) = register_sysctl_table(dummy_table); 16 ]) 17]) 18 19AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_TABLE], [ 20 AC_MSG_CHECKING([whether register_sysctl_table exists]) 21 ZFS_LINUX_TEST_RESULT([has_register_sysctl_table], [ 22 AC_MSG_RESULT([yes]) 23 AC_DEFINE(HAVE_REGISTER_SYSCTL_TABLE, 1, 24 [register_sysctl_table exists]) 25 ],[ 26 AC_MSG_RESULT([no]) 27 ]) 28]) 29 30dnl # 31dnl # Linux 6.11 register_sysctl() enforces that sysctl tables no longer 32dnl # supply a sentinel end-of-table element. 6.6 introduces 33dnl # register_sysctl_sz() to enable callers to choose, so we use it if 34dnl # available for backward compatibility. 35dnl # 36AC_DEFUN([ZFS_AC_KERNEL_SRC_REGISTER_SYSCTL_SZ], [ 37 ZFS_LINUX_TEST_SRC([has_register_sysctl_sz], [ 38 #include <linux/sysctl.h> 39 ],[ 40 struct ctl_table test_table[] __attribute__((unused)) = {{}}; 41 register_sysctl_sz("", test_table, 0); 42 ]) 43]) 44 45AC_DEFUN([ZFS_AC_KERNEL_REGISTER_SYSCTL_SZ], [ 46 AC_MSG_CHECKING([whether register_sysctl_sz exists]) 47 ZFS_LINUX_TEST_RESULT([has_register_sysctl_sz], [ 48 AC_MSG_RESULT([yes]) 49 AC_DEFINE(HAVE_REGISTER_SYSCTL_SZ, 1, 50 [register_sysctl_sz exists]) 51 ],[ 52 AC_MSG_RESULT([no]) 53 ]) 54]) 55 56dnl # 57dnl # Linux 6.11 makes const the ctl_table arg of proc_handler 58dnl # 59AC_DEFUN([ZFS_AC_KERNEL_SRC_PROC_HANDLER_CTL_TABLE_CONST], [ 60 ZFS_LINUX_TEST_SRC([has_proc_handler_ctl_table_const], [ 61 #include <linux/sysctl.h> 62 63 static int test_handler( 64 const struct ctl_table *ctl __attribute((unused)), 65 int write __attribute((unused)), 66 void *buffer __attribute((unused)), 67 size_t *lenp __attribute((unused)), 68 loff_t *ppos __attribute((unused))) 69 { 70 return (0); 71 } 72 ], [ 73 proc_handler *ph __attribute((unused)) = 74 &test_handler; 75 ]) 76]) 77 78AC_DEFUN([ZFS_AC_KERNEL_PROC_HANDLER_CTL_TABLE_CONST], [ 79 AC_MSG_CHECKING([whether proc_handler ctl_table arg is const]) 80 ZFS_LINUX_TEST_RESULT([has_proc_handler_ctl_table_const], [ 81 AC_MSG_RESULT([yes]) 82 AC_DEFINE(HAVE_PROC_HANDLER_CTL_TABLE_CONST, 1, 83 [proc_handler ctl_table arg is const]) 84 ], [ 85 AC_MSG_RESULT([no]) 86 ]) 87]) 88