| 2475 | } |
| 2476 | |
| 2477 | static void |
| 2478 | mq_proc_exit(void *arg __unused, struct proc *p) |
| 2479 | { |
| 2480 | struct filedesc *fdp; |
| 2481 | struct file *fp; |
| 2482 | struct mqueue *mq; |
| 2483 | int i; |
| 2484 | |
| 2485 | fdp = p->p_fd; |
| 2486 | FILEDESC_SLOCK(fdp); |
| 2487 | for (i = 0; i < fdp->fd_nfiles; ++i) { |
| 2488 | fp = fget_locked(fdp, i); |
| 2489 | if (fp != NULL && fp->f_ops == &mqueueops) { |
| 2490 | mq = FPTOMQ(fp); |
| 2491 | mtx_lock(&mq->mq_mutex); |
| 2492 | notifier_remove(p, FPTOMQ(fp), i); |
| 2493 | mtx_unlock(&mq->mq_mutex); |
| 2494 | } |
| 2495 | } |
| 2496 | FILEDESC_SUNLOCK(fdp); |
| 2497 | KASSERT(LIST_EMPTY(&p->p_mqnotifier), ("mq notifiers left")); |
| 2498 | } |
| 2499 | |
| 2500 | static int |
| 2501 | mqf_poll(struct file *fp, int events, struct ucred *active_cred, |
nothing calls this directly
no test coverage detected