summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_exit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 64ea5c3..3dd6521 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1024,6 +1024,7 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
struct rusage *rusage)
{
struct __wrusage wru, *wrup;
+ struct proc *q;
idtype_t idtype;
id_t id;
int ret;
@@ -1031,12 +1032,16 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
if (pid == WAIT_ANY) {
idtype = P_ALL;
id = 0;
- }
- else if (pid <= 0) {
+ } else if (pid == WAIT_MYPGRP) {
+ idtype = P_PGID;
+ q = td->td_proc;
+ PROC_LOCK(q);
+ id = (id_t)q->p_pgid;
+ PROC_UNLOCK(q);
+ } else if (pid < 0) {
idtype = P_PGID;
id = (id_t)-pid;
- }
- else {
+ } else {
idtype = P_PID;
id = (id_t)pid;
}
OpenPOWER on IntegriCloud