MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pgdelete

Function pgdelete

freebsd/kern/kern_proc.c:774–806  ·  view source on GitHub ↗

* delete a process group */

Source from the content-addressed store, hash-verified

772 * delete a process group
773 */
774static void
775pgdelete(struct pgrp *pgrp)
776{
777 struct session *savesess;
778 struct tty *tp;
779
780 sx_assert(&proctree_lock, SX_XLOCKED);
781 PGRP_LOCK_ASSERT(pgrp, MA_NOTOWNED);
782 SESS_LOCK_ASSERT(pgrp->pg_session, MA_NOTOWNED);
783
784 /*
785 * Reset any sigio structures pointing to us as a result of
786 * F_SETOWN with our pgid. The proctree lock ensures that
787 * new sigio structures will not be added after this point.
788 */
789 funsetownlst(&pgrp->pg_sigiolst);
790
791 PGRP_LOCK(pgrp);
792 tp = pgrp->pg_session->s_ttyp;
793 LIST_REMOVE(pgrp, pg_hash);
794 savesess = pgrp->pg_session;
795 PGRP_UNLOCK(pgrp);
796
797 /* Remove the reference to the pgrp before deallocating it. */
798 if (tp != NULL) {
799 tty_lock(tp);
800 tty_rel_pgrp(tp, pgrp);
801 }
802
803 proc_id_clear(PROC_ID_GROUP, pgrp->pg_id);
804 uma_zfree(pgrp_zone, pgrp);
805 sess_release(savesess);
806}
807
808
809static void

Callers 2

doenterpgrpFunction · 0.85
leavepgrpFunction · 0.85

Calls 5

funsetownlstFunction · 0.85
tty_rel_pgrpFunction · 0.85
proc_id_clearFunction · 0.85
sess_releaseFunction · 0.85
uma_zfreeFunction · 0.50

Tested by

no test coverage detected