1 AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT], [
4 dnl # cead18552660702a4a46f58e65188fe5f36e9dfe ("exit: Rename complete_and_exit to kthread_complete_and_exit")
6 dnl # Also moves the definition from include/linux/kernel.h to include/linux/kthread.h
8 AC_MSG_CHECKING([whether kthread_complete_and_exit() is available])
9 ZFS_LINUX_TEST_RESULT([kthread_complete_and_exit], [
11 AC_DEFINE(SPL_KTHREAD_COMPLETE_AND_EXIT, kthread_complete_and_exit, [kthread_complete_and_exit() available])
14 AC_DEFINE(SPL_KTHREAD_COMPLETE_AND_EXIT, complete_and_exit, [using complete_and_exit() instead])
18 AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
20 dnl # 5.17 API: enum pid_type * as new 4th dequeue_signal() argument,
21 dnl # 5768d8906bc23d512b1a736c1e198aa833a6daa4 ("signal: Requeue signals in the appropriate queue")
23 dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info);
24 dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
26 dnl # 6.12 API: first arg struct_task* removed
27 dnl # int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
29 AC_MSG_CHECKING([whether dequeue_signal() takes 4 arguments])
30 ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_4arg], [
32 AC_DEFINE(HAVE_DEQUEUE_SIGNAL_4ARG, 1,
33 [dequeue_signal() takes 4 arguments])
36 AC_MSG_CHECKING([whether dequeue_signal() a task argument])
37 ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_task], [
39 AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_TASK, 1,
40 [dequeue_signal() takes a task argument])
47 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT], [
48 ZFS_LINUX_TEST_SRC([kthread_complete_and_exit], [
49 #include <linux/kthread.h>
51 struct completion *completion = NULL;
54 kthread_complete_and_exit(completion, code);
58 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
59 ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_task], [
60 #include <linux/sched/signal.h>
62 struct task_struct *task = NULL;
63 sigset_t *mask = NULL;
64 kernel_siginfo_t *info = NULL;
65 int error __attribute__ ((unused));
67 error = dequeue_signal(task, mask, info);
70 ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_4arg], [
71 #include <linux/sched/signal.h>
73 struct task_struct *task = NULL;
74 sigset_t *mask = NULL;
75 kernel_siginfo_t *info = NULL;
76 enum pid_type *type = NULL;
77 int error __attribute__ ((unused));
79 error = dequeue_signal(task, mask, info, type);
83 AC_DEFUN([ZFS_AC_KERNEL_KTHREAD], [
84 ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT
85 ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL
88 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD], [
89 ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT
90 ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL