mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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 <behlendorf1@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Issue #810 Issue #10843 Closes #11801
This commit is contained in:
committed by
Brian Behlendorf
parent
9c470dc6c0
commit
d682e20ba4
@@ -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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user