Skip to content

Commit

Permalink
config: add HAVE_DEQUEUE_SIGNAL_3ARG_SIGINFO
Browse files Browse the repository at this point in the history
The dequeue_signal API accepts siginfo_t as the third parameter instead of kernel_siginfo_t
in 4.18 and 4.19.

Signed-off-by: Finix <[email protected]>
  • Loading branch information
Finix committed Oct 18, 2024
1 parent 27e8f56 commit 754e15c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
20 changes: 20 additions & 0 deletions config/kernel-kthread.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_COMPLETE_AND_EXIT], [
])

AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
dnl #
dnl # Earlier than 4.20 API:
dnl # int dequeue_signal(struct task_struct *task, sigset_t *mask, siginfo_t *info);
dnl #
dnl # 5.17 API: enum pid_type * as new 4th dequeue_signal() argument,
dnl # 5768d8906bc23d512b1a736c1e198aa833a6daa4 ("signal: Requeue signals in the appropriate queue")
Expand All @@ -40,6 +43,12 @@ AC_DEFUN([ZFS_AC_KERNEL_KTHREAD_DEQUEUE_SIGNAL], [
[dequeue_signal() takes a task argument])
], [
AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether dequeue_signal() a siginfo argument])
ZFS_LINUX_TEST_RESULT([kthread_dequeue_signal_3arg_siginfo], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DEQUEUE_SIGNAL_3ARG_SIGINFO, 1,
[dequeue_signal() takes a siginfo argument])
])
])
])
])
Expand All @@ -56,6 +65,17 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_COMPLETE_AND_EXIT], [
])

AC_DEFUN([ZFS_AC_KERNEL_SRC_KTHREAD_DEQUEUE_SIGNAL], [
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_siginfo], [
#include <linux/sched/signal.h>
], [
struct task_struct *task = NULL;
sigset_t *mask = NULL;
siginfo_t *info = NULL;
int error __attribute__ ((unused));
error = dequeue_signal(task, mask, info);
])
ZFS_LINUX_TEST_SRC([kthread_dequeue_signal_3arg_task], [
#include <linux/sched/signal.h>
], [
Expand Down
3 changes: 2 additions & 1 deletion module/os/linux/spl/spl-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ issig(void)
#if defined(HAVE_DEQUEUE_SIGNAL_4ARG)
enum pid_type __type;
if (dequeue_signal(current, &set, &__info, &__type) != 0) {
#elif defined(HAVE_DEQUEUE_SIGNAL_3ARG_TASK)
#elif defined(HAVE_DEQUEUE_SIGNAL_3ARG_TASK) || \
defined(HAVE_DEQUEUE_SIGNAL_3ARG_SIGINFO)
if (dequeue_signal(current, &set, &__info) != 0) {
#else
enum pid_type __type;
Expand Down

0 comments on commit 754e15c

Please sign in to comment.