summaryrefslogtreecommitdiff
path: root/proc/pgrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'proc/pgrp.c')
-rw-r--r--proc/pgrp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/proc/pgrp.c b/proc/pgrp.c
index 5caedb00..f65d5427 100644
--- a/proc/pgrp.c
+++ b/proc/pgrp.c
@@ -223,15 +223,20 @@ S_proc_getpgrppids (struct proc *callerp,
pid_t **pids,
u_int *npidsp)
{
- int count;
+
struct proc *p;
struct pgrp *pg;
pid_t *pp = *pids;
int npids = *npidsp;
- pg = pgrp_find (pgid);
- if (!pg)
- return ESRCH;
+ if (pgid == 0)
+ pg = callerp->p_pgrp;
+ else
+ {
+ pg = pgrp_find (pgid);
+ if (!pg)
+ return ESRCH;
+ }
count = 0;
for (p = pg->pg_plist; p; p = p->p_gnext)