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

Function mq_proc_exit

freebsd/kern/uipc_mqueue.c:2477–2498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2475}
2476
2477static void
2478mq_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
2500static int
2501mqf_poll(struct file *fp, int events, struct ucred *active_cred,

Callers

nothing calls this directly

Calls 4

fget_lockedFunction · 0.85
notifier_removeFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected