* Locate a process group by number. * The caller must hold proctree_lock. */
| 482 | * The caller must hold proctree_lock. |
| 483 | */ |
| 484 | struct pgrp * |
| 485 | pgfind(pid_t pgid) |
| 486 | { |
| 487 | struct pgrp *pgrp; |
| 488 | |
| 489 | sx_assert(&proctree_lock, SX_LOCKED); |
| 490 | |
| 491 | LIST_FOREACH(pgrp, PGRPHASH(pgid), pg_hash) { |
| 492 | if (pgrp->pg_id == pgid) { |
| 493 | PGRP_LOCK(pgrp); |
| 494 | return (pgrp); |
| 495 | } |
| 496 | } |
| 497 | return (NULL); |
| 498 | } |
| 499 | |
| 500 | /* |
| 501 | * Locate process and do additional manipulations, depending on flags. |
no outgoing calls
no test coverage detected