summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Dagnelie <[email protected]>2021-04-15 13:34:35 -0700
committerBrian Behlendorf <[email protected]>2021-04-19 15:12:33 -0700
commitd682e20ba4a38a464b12027bddf234415b18dad6 (patch)
tree9e4b458b56c7f4161d2d795c7a8a777f549cc524 /include
parent9c470dc6c0a44c2ac78e6bf4d75445087395f8ad (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 'include')
-rw-r--r--include/os/linux/spl/sys/signal.h18
-rw-r--r--include/os/linux/spl/sys/thread.h13
2 files changed, 14 insertions, 17 deletions
diff --git a/include/os/linux/spl/sys/signal.h b/include/os/linux/spl/sys/signal.h
index fd32f08b3..6b538c896 100644
--- a/include/os/linux/spl/sys/signal.h
+++ b/include/os/linux/spl/sys/signal.h
@@ -33,22 +33,6 @@
#define FORREAL 0 /* Usual side-effects */
#define JUSTLOOKING 1 /* Don't stop the process */
-/*
- * The "why" argument indicates the allowable side-effects of the call:
- *
- * FORREAL: Extract the next pending signal from p_sig into p_cursig;
- * stop the process if a stop has been requested or if a traced signal
- * is pending.
- *
- * JUSTLOOKING: Don't stop the process, just indicate whether or not
- * a signal might be pending (FORREAL is needed to tell for sure).
- */
-static __inline__ int
-issig(int why)
-{
- ASSERT(why == FORREAL || why == JUSTLOOKING);
-
- return (signal_pending(current));
-}
+extern int issig(int why);
#endif /* SPL_SIGNAL_H */
diff --git a/include/os/linux/spl/sys/thread.h b/include/os/linux/spl/sys/thread.h
index 99d9c9bf3..220742387 100644
--- a/include/os/linux/spl/sys/thread.h
+++ b/include/os/linux/spl/sys/thread.h
@@ -70,4 +70,17 @@ extern struct task_struct *spl_kthread_create(int (*func)(void *),
extern proc_t p0;
+#ifdef HAVE_SIGINFO
+typedef kernel_siginfo_t spl_kernel_siginfo_t;
+#else
+typedef siginfo_t spl_kernel_siginfo_t;
+#endif
+
+#ifdef HAVE_SET_SPECIAL_STATE
+#define spl_set_special_state(x) set_special_state((x))
+#else
+#define spl_set_special_state(x) __set_current_state((x))
+#endif
+
+
#endif /* _SPL_THREAD_H */