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

Function sem_prison_cleanup

freebsd/kern/sysv_sem.c:1709–1725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1707}
1708
1709static void
1710sem_prison_cleanup(struct prison *pr)
1711{
1712 int i;
1713
1714 /* Remove any sems that belong to this jail. */
1715 mtx_lock(&sem_mtx);
1716 for (i = 0; i < seminfo.semmni; i++) {
1717 if ((sema[i].u.sem_perm.mode & SEM_ALLOC) &&
1718 sema[i].cred != NULL && sema[i].cred->cr_prison == pr) {
1719 mtx_lock(&sema_mtx[i]);
1720 sem_remove(i, NULL);
1721 mtx_unlock(&sema_mtx[i]);
1722 }
1723 }
1724 mtx_unlock(&sem_mtx);
1725}
1726
1727SYSCTL_JAIL_PARAM_SYS_NODE(sysvsem, CTLFLAG_RW, "SYSV semaphores");
1728

Callers 2

sem_prison_setFunction · 0.85
sem_prison_removeFunction · 0.85

Calls 3

sem_removeFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected