| 1707 | } |
| 1708 | |
| 1709 | static void |
| 1710 | sem_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 | |
| 1727 | SYSCTL_JAIL_PARAM_SYS_NODE(sysvsem, CTLFLAG_RW, "SYSV semaphores"); |
| 1728 |
no test coverage detected