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], [
21 dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
22 dnl # siginfo_t *info)
24 dnl # 4.20: kernel_siginfo_t introduced, replaces siginfo_t
25 dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
26 dnl kernel_siginfo_t *info)
28 dnl # 5.17: enum pid_type introduced as 4th arg
29 dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask,
30 dnl # kernel_siginfo_t *info, enum pid_type *type)
32 dnl # 6.12: first arg struct_task* removed
33 dnl # int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info,
34 dnl # enum pid_type *type)
36 AC_MSG_CHECKING([whether dequeue_signal() takes 4 arguments])
37 ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_4arg], [
39 AC_DEFINE(HAVE_DEQUEUE_SIGNAL_4ARG, 1,
40 [dequeue_signal() takes 4 arguments])
43 AC_MSG_CHECKING([whether 3-arg dequeue_signal() takes a type argument])
44 ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_type], [
46 AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_TYPE, 1,
47 [3-arg dequeue_signal() takes a type argument])
54 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT], [
55 ZFS_LINUX_TEST_SRC([kthread_complete_and_exit], [
56 #include <linux/kthread.h>
58 struct completion *completion = NULL;
61 kthread_complete_and_exit(completion, code);
65 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
66 ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_4arg], [
67 #include <linux/sched/signal.h>
69 struct task_struct *task = NULL;
70 sigset_t *mask = NULL;
71 kernel_siginfo_t *info = NULL;
72 enum pid_type *type = NULL;
73 int error __attribute__ ((unused));
75 error = dequeue_signal(task, mask, info, type);
78 ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_type], [
79 #include <linux/sched/signal.h>
81 sigset_t *mask = NULL;
82 kernel_siginfo_t *info = NULL;
83 enum pid_type *type = NULL;
84 int error __attribute__ ((unused));
86 error = dequeue_signal(mask, info, type);
90 AC_DEFUN([ZFS_AC_KERNEL_KTHREAD], [
91 ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT
92 ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL
95 AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD], [
96 ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT
97 ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL