diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2020-12-27 00:53:20 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-12-27 00:53:20 +0100 |
commit | a14bade6c6c17df9c0877c30e4903a1e2d8175fd (patch) | |
tree | a5a1b1a7fd839ba1ab300a6a2e548e2af7e305ba /proc | |
parent | 2d43074ac578d3a4ce97bf00e5c4882c9f287486 (diff) | |
download | hurd-a14bade6c6c17df9c0877c30e4903a1e2d8175fd.tar.gz hurd-a14bade6c6c17df9c0877c30e4903a1e2d8175fd.tar.bz2 hurd-a14bade6c6c17df9c0877c30e4903a1e2d8175fd.zip |
proc: send signals with POSIX sigcodes
* proc/stubs.c (send_signal): Add a sigcode argument.
* proc/proc.h (send_signal): Declare the sigcode argument.
* proc/pgrp.c (leave_pgrp): Specify a null sigcode.
* proc/wait.c (alert_parent): Use CLD_EXITED for SIGCHLD on exit.
(S_proc_mark_stop): Use CLD_STOPPED for SIGCHLD on stop.
Diffstat (limited to 'proc')
-rw-r--r-- | proc/pgrp.c | 4 | ||||
-rw-r--r-- | proc/proc.h | 2 | ||||
-rw-r--r-- | proc/stubs.c | 3 | ||||
-rw-r--r-- | proc/wait.c | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/proc/pgrp.c b/proc/pgrp.c index a7876764..07e587a3 100644 --- a/proc/pgrp.c +++ b/proc/pgrp.c @@ -523,8 +523,8 @@ leave_pgrp (struct proc *p) if (dosignal) for (ip = pg->pg_plist; ip; ip = ip->p_gnext) { - send_signal (ip->p_msgport, SIGHUP, ip->p_task); - send_signal (ip->p_msgport, SIGCONT, ip->p_task); + send_signal (ip->p_msgport, SIGHUP, 0, ip->p_task); + send_signal (ip->p_msgport, SIGCONT, 0, ip->p_task); } } } diff --git a/proc/proc.h b/proc/proc.h index 95f9e3d5..64f276d3 100644 --- a/proc/proc.h +++ b/proc/proc.h @@ -213,7 +213,7 @@ void complete_exit (struct proc *); void initialize_version_info (void); -void send_signal (mach_port_t, int, mach_port_t); +void send_signal (mach_port_t, int, int, mach_port_t); #endif diff --git a/proc/stubs.c b/proc/stubs.c index b5f9d09b..50882418 100644 --- a/proc/stubs.c +++ b/proc/stubs.c @@ -76,6 +76,7 @@ blocking_message_send (void *arg) void send_signal (mach_port_t msgport, int signal, + int sigcode, mach_port_t refport) { error_t err; @@ -118,7 +119,7 @@ send_signal (mach_port_t msgport, 0, /* msgt_unused */ }, /* Sigcode */ - 0, + sigcode, { /* Type descriptor for refport */ MACH_MSG_TYPE_COPY_SEND, /* msgt_name */ diff --git a/proc/wait.c b/proc/wait.c index e8c379a0..8883d458 100644 --- a/proc/wait.c +++ b/proc/wait.c @@ -145,7 +145,7 @@ alert_parent (struct proc *p) /* We accumulate the aggregate usage stats of all our dead children. */ rusage_add (&p->p_parent->p_child_rusage, &p->p_rusage); - send_signal (p->p_parent->p_msgport, SIGCHLD, p->p_parent->p_task); + send_signal (p->p_parent->p_msgport, SIGCHLD, CLD_EXITED, p->p_parent->p_task); if (!p->p_exiting) { @@ -258,7 +258,7 @@ S_proc_mark_stop (struct proc *p, } if (!p->p_parent->p_nostopcld) - send_signal (p->p_parent->p_msgport, SIGCHLD, p->p_parent->p_task); + send_signal (p->p_parent->p_msgport, SIGCHLD, CLD_STOPPED, p->p_parent->p_task); return 0; } |