Skip to content

SR-4026: dispatch_test_check_evfilt_read_for_fd for epoll #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions tests/dispatch_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#if __has_include(<sys/event.h>)
#define HAS_SYS_EVENT_H 1
#include <sys/event.h>
#else
#include <sys/poll.h>
#endif
#include <assert.h>

Expand Down Expand Up @@ -65,8 +67,16 @@ dispatch_test_check_evfilt_read_for_fd(int fd)
close(kq);
return r > 0;
#else
// TODO: Need to write a real check for epoll-backend here
return true;
struct pollfd pfd = {
.fd = fd,
.events = POLLIN,
};
int rc;
do {
rc = poll(&pfd, 1, 0);
} while (rc == -1 && errno == EINTR);
assert(rc != -1);
return rc == 1;
#endif
}

Expand Down