Add proper IO events for unbound sockets

This commit is contained in:
Ruihan Li
2024-01-09 23:42:59 +08:00
committed by Tate, Hongliang Tian
parent 8628543067
commit 9211061181
6 changed files with 23 additions and 14 deletions

View File

@ -234,14 +234,12 @@ FN_TEST(poll)
struct pollfd pfd = { .events = POLLIN | POLLOUT };
pfd.fd = sk_unbound;
// FIXME: Uncomment this
// TEST_RES(poll(&pfd, 1, 0),
// (pfd.revents & (POLLIN | POLLOUT)) == POLLOUT);
TEST_RES(poll(&pfd, 1, 0),
(pfd.revents & (POLLIN | POLLOUT)) == POLLOUT);
pfd.fd = sk_bound;
// FIXME: Uncomment this
// TEST_RES(poll(&pfd, 1, 0),
// (pfd.revents & (POLLIN | POLLOUT)) == POLLOUT);
TEST_RES(poll(&pfd, 1, 0),
(pfd.revents & (POLLIN | POLLOUT)) == POLLOUT);
pfd.fd = sk_listen;
TEST_RES(poll(&pfd, 1, 0), (pfd.revents & (POLLIN | POLLOUT)) == 0);