Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: add HAVE_DEQUEUE_SIGNAL_3ARG_SIGINFO #16662

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading