diff options
author | Paul Dagnelie <[email protected]> | 2021-04-15 13:34:35 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-19 15:12:33 -0700 |
commit | d682e20ba4a38a464b12027bddf234415b18dad6 (patch) | |
tree | 9e4b458b56c7f4161d2d795c7a8a777f549cc524 /config | |
parent | 9c470dc6c0a44c2ac78e6bf4d75445087395f8ad (diff) |
Add SIGSTOP and SIGTSTP handling to issig
This change adds SIGSTOP and SIGTSTP handling to the issig function;
this mirrors its behavior on Solaris. This way, long running kernel
tasks can be stopped with the appropriate signals. Note that doing
so with ctrl-z on the command line doesn't return control of the tty
to the shell, because tty handling is done separately from stopping
the process. That can be future work, if people feel that it is a
necessary addition.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Matthew Ahrens <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Issue #810
Issue #10843
Closes #11801
Diffstat (limited to 'config')
-rw-r--r-- | config/kernel-siginfo.m4 | 21 | ||||
-rw-r--r-- | config/kernel-signal-stop.m4 | 21 | ||||
-rw-r--r-- | config/kernel-special-state.m4 | 21 | ||||
-rw-r--r-- | config/kernel.m4 | 6 |
4 files changed, 69 insertions, 0 deletions
diff --git a/config/kernel-siginfo.m4 b/config/kernel-siginfo.m4 new file mode 100644 index 000000000..6ddb0dcc3 --- /dev/null +++ b/config/kernel-siginfo.m4 @@ -0,0 +1,21 @@ +dnl # +dnl # 4.20 API change +dnl # Added kernel_siginfo_t +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_SIGINFO], [ + ZFS_LINUX_TEST_SRC([siginfo], [ + #include <linux/signal_types.h> + ],[ + kernel_siginfo_t info __attribute__ ((unused)); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_SIGINFO], [ + AC_MSG_CHECKING([whether kernel_siginfo_t tyepedef exists]) + ZFS_LINUX_TEST_RESULT([siginfo], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SIGINFO, 1, [kernel_siginfo_t exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel-signal-stop.m4 b/config/kernel-signal-stop.m4 new file mode 100644 index 000000000..6cb86e7c4 --- /dev/null +++ b/config/kernel-signal-stop.m4 @@ -0,0 +1,21 @@ +dnl # +dnl # 4.4 API change +dnl # Added kernel_signal_stop +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_SIGNAL_STOP], [ + ZFS_LINUX_TEST_SRC([signal_stop], [ + #include <linux/sched/signal.h> + ],[ + kernel_signal_stop(); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_SIGNAL_STOP], [ + AC_MSG_CHECKING([whether signal_stop() exists]) + ZFS_LINUX_TEST_RESULT([signal_stop], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SIGNAL_STOP, 1, [signal_stop() exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel-special-state.m4 b/config/kernel-special-state.m4 new file mode 100644 index 000000000..aa60aabeb --- /dev/null +++ b/config/kernel-special-state.m4 @@ -0,0 +1,21 @@ +dnl # +dnl # 4.17 API change +dnl # Added set_special_state() function +dnl # +AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE], [ + ZFS_LINUX_TEST_SRC([set_special_state], [ + #include <linux/sched.h> + ],[ + set_special_state(TASK_STOPPED); + ]) +]) + +AC_DEFUN([ZFS_AC_KERNEL_SET_SPECIAL_STATE], [ + AC_MSG_CHECKING([whether set_special_state() exists]) + ZFS_LINUX_TEST_RESULT([set_special_state], [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SET_SPECIAL_STATE, 1, [set_special_state() exists]) + ],[ + AC_MSG_RESULT(no) + ]) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index dfb6165d8..7196e66ca 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -129,6 +129,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [ ZFS_AC_KERNEL_SRC_MKNOD ZFS_AC_KERNEL_SRC_SYMLINK ZFS_AC_KERNEL_SRC_BIO_MAX_SEGS + ZFS_AC_KERNEL_SRC_SIGNAL_STOP + ZFS_AC_KERNEL_SRC_SIGINFO + ZFS_AC_KERNEL_SRC_SET_SPECIAL_STATE AC_MSG_CHECKING([for available kernel interfaces]) ZFS_LINUX_TEST_COMPILE_ALL([kabi]) @@ -231,6 +234,9 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [ ZFS_AC_KERNEL_MKNOD ZFS_AC_KERNEL_SYMLINK ZFS_AC_KERNEL_BIO_MAX_SEGS + ZFS_AC_KERNEL_SIGNAL_STOP + ZFS_AC_KERNEL_SIGINFO + ZFS_AC_KERNEL_SET_SPECIAL_STATE ]) dnl # |