4 #include <darwintest.h>
6 /* <rdar://problem/28139044> EVFILT_USER doesn't properly support add&fire atomic combination
8 * Chek that using EV_ADD and EV_TRIGGER on a EV_USER actually trigger the event just added.
12 T_DECL(kqueue_add_and_trigger_evfilt_user
, "Add and trigger EVFILT_USER events with kevent ")
15 struct kevent ret_kev
;
16 const struct kevent kev
= {
18 .filter
= EVFILT_USER
,
19 .flags
= EV_ADD
|EV_CLEAR
,
20 .fflags
= NOTE_TRIGGER
,
22 const struct timespec timeout
= {
27 T_ASSERT_POSIX_SUCCESS((kq_fd
= kqueue()), NULL
);
28 ret
= kevent(kq_fd
, &kev
, 1, &ret_kev
, 1, &timeout
);
30 T_ASSERT_POSIX_SUCCESS(ret
, "kevent");
32 T_ASSERT_EQ(ret
, 1, "kevent with add and trigger, ret");
33 T_ASSERT_EQ(ret_kev
.ident
, 1, "kevent with add and trigger, ident");
34 T_ASSERT_EQ(ret_kev
.filter
, EVFILT_USER
, "kevent with add and trigger, filter");