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