diff options
Diffstat (limited to 'usr/src/uts/common/os')
-rw-r--r-- | usr/src/uts/common/os/exit.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/os/sig.c | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/usr/src/uts/common/os/exit.c b/usr/src/uts/common/os/exit.c index c5d54b5978..f0c0983a3a 100644 --- a/usr/src/uts/common/os/exit.c +++ b/usr/src/uts/common/os/exit.c @@ -455,6 +455,14 @@ proc_exit(int why, int what) (*dtrace_helpers_cleanup)(); } + /* + * Clean up any signalfd state for the process. + */ + if (p->p_sigfd != NULL) { + VERIFY(sigfd_exit_helper != NULL); + (*sigfd_exit_helper)(); + } + /* untimeout the realtime timers */ if (p->p_itimer != NULL) timer_exit(); diff --git a/usr/src/uts/common/os/sig.c b/usr/src/uts/common/os/sig.c index 0b79c3765a..453b1f22d4 100644 --- a/usr/src/uts/common/os/sig.c +++ b/usr/src/uts/common/os/sig.c @@ -60,6 +60,7 @@ #include <sys/cyclic.h> #include <sys/dtrace.h> #include <sys/sdt.h> +#include <sys/signalfd.h> const k_sigset_t nullsmask = {0, 0, 0}; @@ -94,6 +95,12 @@ const k_sigset_t holdvfork = static int isjobstop(int); static void post_sigcld(proc_t *, sigqueue_t *); + +/* + * signalfd helper function which is set when the signalfd driver loads. + */ +void (*sigfd_exit_helper)(); + /* * Internal variables for counting number of user thread stop requests posted. * They may not be accurate at some special situation such as that a virtually @@ -307,6 +314,11 @@ sigtoproc(proc_t *p, kthread_t *t, int sig) (void) eat_signal(t, sig); thread_unlock(t); DTRACE_PROC2(signal__send, kthread_t *, t, int, sig); + if (p->p_sigfd != NULL && ((sigfd_proc_state_t *) + (p->p_sigfd))->sigfd_pollwake_cb != NULL) + (*((sigfd_proc_state_t *)(p->p_sigfd))-> + sigfd_pollwake_cb)(p, sig); + } else if ((tt = p->p_tlist) != NULL) { /* * Make sure that some lwp that already exists @@ -345,6 +357,10 @@ sigtoproc(proc_t *p, kthread_t *t, int sig) } DTRACE_PROC2(signal__send, kthread_t *, tt, int, sig); + if (p->p_sigfd != NULL && ((sigfd_proc_state_t *) + (p->p_sigfd))->sigfd_pollwake_cb != NULL) + (*((sigfd_proc_state_t *)(p->p_sigfd))-> + sigfd_pollwake_cb)(p, sig); } } |