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

Function kqueue_acquire

freebsd/kern/kern_event.c:1638–1659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1636}
1637
1638static int
1639kqueue_acquire(struct file *fp, struct kqueue **kqp)
1640{
1641 int error;
1642 struct kqueue *kq;
1643
1644 error = 0;
1645
1646 kq = fp->f_data;
1647 if (fp->f_type != DTYPE_KQUEUE || kq == NULL)
1648 return (EBADF);
1649 *kqp = kq;
1650 KQ_LOCK(kq);
1651 if ((kq->kq_state & KQ_CLOSING) == KQ_CLOSING) {
1652 KQ_UNLOCK(kq);
1653 return (EBADF);
1654 }
1655 kq->kq_refcnt++;
1656 KQ_UNLOCK(kq);
1657
1658 return error;
1659}
1660
1661static void
1662kqueue_release(struct kqueue *kq, int locked)

Callers 4

kern_kevent_fpFunction · 0.85
kqueue_pollFunction · 0.85
kqueue_closeFunction · 0.85
kqfd_registerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected