We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b6f8908 + ee8143e commit 7ca0a63Copy full SHA for 7ca0a63
tests/dispatch_test.c
@@ -31,6 +31,8 @@
31
#if __has_include(<sys/event.h>)
32
#define HAS_SYS_EVENT_H 1
33
#include <sys/event.h>
34
+#else
35
+#include <sys/poll.h>
36
#endif
37
#include <assert.h>
38
@@ -65,8 +67,16 @@ dispatch_test_check_evfilt_read_for_fd(int fd)
65
67
close(kq);
66
68
return r > 0;
69
#else
- // TODO: Need to write a real check for epoll-backend here
- return true;
70
+ struct pollfd pfd = {
71
+ .fd = fd,
72
+ .events = POLLIN,
73
+ };
74
+ int rc;
75
+ do {
76
+ rc = poll(&pfd, 1, 0);
77
+ } while (rc == -1 && errno == EINTR);
78
+ assert(rc != -1);
79
+ return rc == 1;
80
81
}
82
0 commit comments