Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_event.c
Show First 20 Lines • Show All 1,051 Lines • ▼ Show 20 Lines | |||||
int | int | ||||
sys_kqueue(struct thread *td, struct kqueue_args *uap) | sys_kqueue(struct thread *td, struct kqueue_args *uap) | ||||
{ | { | ||||
return (kern_kqueue(td, 0, NULL)); | return (kern_kqueue(td, 0, NULL)); | ||||
} | } | ||||
int | |||||
sys_kqueue1(struct thread *td, struct kqueue1_args *uap) | |||||
{ | |||||
int flags; | |||||
if ((uap->flags & ~(KQUEUE_CLOEXEC)) != 0) | |||||
return (EINVAL); | |||||
flags = 0; | |||||
if ((uap->flags & KQUEUE_CLOEXEC) != 0) | |||||
flags |= O_CLOEXEC; | |||||
return (kern_kqueue(td, flags, NULL)); | |||||
} | |||||
static void | static void | ||||
kqueue_init(struct kqueue *kq) | kqueue_init(struct kqueue *kq) | ||||
{ | { | ||||
mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF | MTX_DUPOK); | mtx_init(&kq->kq_lock, "kqueue", NULL, MTX_DEF | MTX_DUPOK); | ||||
TAILQ_INIT(&kq->kq_head); | TAILQ_INIT(&kq->kq_head); | ||||
knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); | knlist_init_mtx(&kq->kq_sel.si_note, &kq->kq_lock); | ||||
TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); | TASK_INIT(&kq->kq_task, 0, kqueue_task, kq); | ||||
▲ Show 20 Lines • Show All 1,753 Lines • Show Last 20 Lines |