Lines Matching +full:2 +full:e

37 	struct epoll_event e;  in waiter_entry1a()  local
40 if (epoll_wait(ctx->efd[0], &e, 1, -1) > 0) in waiter_entry1a()
49 struct epoll_event e; in waiter_entry1ap() local
55 if (epoll_wait(ctx->efd[0], &e, 1, 0) > 0) in waiter_entry1ap()
64 struct epoll_event e; in waiter_entry1o() local
67 if (epoll_wait(ctx->efd[0], &e, 1, -1) > 0) in waiter_entry1o()
76 struct epoll_event e; in waiter_entry1op() local
82 if (epoll_wait(ctx->efd[0], &e, 1, 0) > 0) in waiter_entry1op()
91 struct epoll_event events[2]; in waiter_entry2a()
94 if (epoll_wait(ctx->efd[0], events, 2, -1) > 0) in waiter_entry2a()
103 struct epoll_event events[2]; in waiter_entry2ap()
109 if (epoll_wait(ctx->efd[0], events, 2, 0) > 0) in waiter_entry2ap()
151 int sfd[2]; in TEST()
152 struct epoll_event e; in TEST() local
159 e.events = EPOLLIN; in TEST()
160 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
164 EXPECT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
165 EXPECT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
182 int sfd[2]; in TEST()
183 struct epoll_event e; in TEST() local
190 e.events = EPOLLIN | EPOLLET; in TEST()
191 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
195 EXPECT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
196 EXPECT_EQ(epoll_wait(efd, &e, 1, 0), 0); in TEST()
214 struct epoll_event events[2]; in TEST()
217 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
226 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
231 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
232 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
237 close(sfd[2]); in TEST()
252 struct epoll_event events[2]; in TEST()
255 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
264 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
269 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
270 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 0); in TEST()
275 close(sfd[2]); in TEST()
289 int sfd[2]; in TEST()
291 struct epoll_event e; in TEST() local
298 e.events = EPOLLIN; in TEST()
299 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
306 ASSERT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
311 ASSERT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
328 int sfd[2]; in TEST()
330 struct epoll_event e; in TEST() local
337 e.events = EPOLLIN | EPOLLET; in TEST()
338 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
345 ASSERT_EQ(epoll_wait(efd, &e, 1, 0), 1); in TEST()
350 ASSERT_EQ(epoll_wait(efd, &e, 1, 0), 0); in TEST()
370 struct epoll_event events[2]; in TEST()
373 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
382 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
390 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
395 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
400 close(sfd[2]); in TEST()
416 struct epoll_event events[2]; in TEST()
419 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
428 ASSERT_EQ(epoll_ctl(efd, EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
436 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 2); in TEST()
441 EXPECT_EQ(epoll_wait(efd, events, 2, 0), 0); in TEST()
446 close(sfd[2]); in TEST()
460 struct epoll_event e; in TEST() local
470 e.events = EPOLLIN; in TEST()
471 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
477 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
481 EXPECT_EQ(ctx.count, 2); in TEST()
503 struct epoll_event e; in TEST() local
513 e.events = EPOLLIN | EPOLLET; in TEST()
514 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
520 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
546 struct epoll_event events[2]; in TEST()
552 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
561 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[2], events), 0); in TEST()
567 if (epoll_wait(ctx.efd[0], events, 2, -1) > 0) in TEST()
571 EXPECT_EQ(ctx.count, 2); in TEST()
581 close(ctx.sfd[2]); in TEST()
595 struct epoll_event events[2]; in TEST()
601 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
610 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[2], events), 0); in TEST()
620 EXPECT_EQ(ctx.count, 2); in TEST()
630 close(ctx.sfd[2]); in TEST()
644 struct epoll_event e; in TEST() local
654 e.events = EPOLLIN; in TEST()
655 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
661 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
665 EXPECT_EQ(ctx.count, 2); in TEST()
687 struct epoll_event e; in TEST() local
697 e.events = EPOLLIN | EPOLLET; in TEST()
698 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
704 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
730 struct epoll_event events[2]; in TEST()
736 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
745 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[2], events), 0); in TEST()
751 if (epoll_wait(ctx.efd[0], events, 2, -1) > 0) in TEST()
755 EXPECT_EQ(ctx.count, 2); in TEST()
765 close(ctx.sfd[2]); in TEST()
779 struct epoll_event events[2]; in TEST()
785 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
794 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[2], events), 0); in TEST()
804 EXPECT_EQ(ctx.count, 2); in TEST()
814 close(ctx.sfd[2]); in TEST()
829 int efd[2]; in TEST()
830 int sfd[2]; in TEST()
831 struct epoll_event e; in TEST() local
841 e.events = EPOLLIN; in TEST()
842 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
844 e.events = EPOLLIN; in TEST()
845 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
849 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
850 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
869 int efd[2]; in TEST()
870 int sfd[2]; in TEST()
871 struct epoll_event e; in TEST() local
881 e.events = EPOLLIN | EPOLLET; in TEST()
882 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
884 e.events = EPOLLIN; in TEST()
885 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
889 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
890 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
909 int efd[2]; in TEST()
910 int sfd[2]; in TEST()
911 struct epoll_event e; in TEST() local
921 e.events = EPOLLIN; in TEST()
922 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
924 e.events = EPOLLIN | EPOLLET; in TEST()
925 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
929 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
930 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 0); in TEST()
949 int efd[2]; in TEST()
950 int sfd[2]; in TEST()
951 struct epoll_event e; in TEST() local
961 e.events = EPOLLIN | EPOLLET; in TEST()
962 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
964 e.events = EPOLLIN | EPOLLET; in TEST()
965 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
969 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
970 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 0); in TEST()
989 int efd[2]; in TEST()
990 int sfd[2]; in TEST()
992 struct epoll_event e; in TEST() local
1002 e.events = EPOLLIN; in TEST()
1003 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
1005 e.events = EPOLLIN; in TEST()
1006 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
1013 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1018 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1037 int efd[2]; in TEST()
1038 int sfd[2]; in TEST()
1040 struct epoll_event e; in TEST() local
1050 e.events = EPOLLIN | EPOLLET; in TEST()
1051 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
1053 e.events = EPOLLIN; in TEST()
1054 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
1061 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1066 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1085 int efd[2]; in TEST()
1086 int sfd[2]; in TEST()
1088 struct epoll_event e; in TEST() local
1098 e.events = EPOLLIN; in TEST()
1099 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
1101 e.events = EPOLLIN | EPOLLET; in TEST()
1102 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
1109 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1114 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 0); in TEST()
1133 int efd[2]; in TEST()
1134 int sfd[2]; in TEST()
1136 struct epoll_event e; in TEST() local
1146 e.events = EPOLLIN | EPOLLET; in TEST()
1147 ASSERT_EQ(epoll_ctl(efd[1], EPOLL_CTL_ADD, sfd[0], &e), 0); in TEST()
1149 e.events = EPOLLIN | EPOLLET; in TEST()
1150 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[1], &e), 0); in TEST()
1157 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 1); in TEST()
1162 EXPECT_EQ(epoll_wait(efd[0], &e, 1, 0), 0); in TEST()
1182 struct epoll_event e; in TEST() local
1195 e.events = EPOLLIN; in TEST()
1196 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1198 e.events = EPOLLIN; in TEST()
1199 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1205 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1209 EXPECT_EQ(ctx.count, 2); in TEST()
1234 struct epoll_event e; in TEST() local
1247 e.events = EPOLLIN | EPOLLET; in TEST()
1248 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1250 e.events = EPOLLIN; in TEST()
1251 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1257 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1261 EXPECT_EQ(ctx.count, 2); in TEST()
1286 struct epoll_event e; in TEST() local
1299 e.events = EPOLLIN; in TEST()
1300 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1302 e.events = EPOLLIN | EPOLLET; in TEST()
1303 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1309 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1338 struct epoll_event e; in TEST() local
1351 e.events = EPOLLIN | EPOLLET; in TEST()
1352 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1354 e.events = EPOLLIN | EPOLLET; in TEST()
1355 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1361 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1390 struct epoll_event e; in TEST() local
1403 e.events = EPOLLIN; in TEST()
1404 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1406 e.events = EPOLLIN; in TEST()
1407 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1413 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1417 EXPECT_EQ(ctx.count, 2); in TEST()
1441 struct epoll_event e; in TEST() local
1454 e.events = EPOLLIN | EPOLLET; in TEST()
1455 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1457 e.events = EPOLLIN; in TEST()
1458 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1464 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1468 EXPECT_EQ(ctx.count, 2); in TEST()
1492 struct epoll_event e; in TEST() local
1505 e.events = EPOLLIN; in TEST()
1506 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1508 e.events = EPOLLIN | EPOLLET; in TEST()
1509 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1515 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1543 struct epoll_event e; in TEST() local
1556 e.events = EPOLLIN | EPOLLET; in TEST()
1557 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1559 e.events = EPOLLIN | EPOLLET; in TEST()
1560 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1566 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
1594 struct epoll_event e; in TEST() local
1607 e.events = EPOLLIN; in TEST()
1608 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1610 e.events = EPOLLIN; in TEST()
1611 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1617 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
1621 EXPECT_EQ(ctx.count, 2); in TEST()
1646 struct epoll_event e; in TEST() local
1659 e.events = EPOLLIN | EPOLLET; in TEST()
1660 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1662 e.events = EPOLLIN; in TEST()
1663 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1669 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
1670 __sync_fetch_and_or(&ctx.count, 2); in TEST()
1673 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
1698 struct epoll_event e; in TEST() local
1711 e.events = EPOLLIN; in TEST()
1712 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1714 e.events = EPOLLIN | EPOLLET; in TEST()
1715 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1721 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
1725 EXPECT_EQ(ctx.count, 2); in TEST()
1750 struct epoll_event e; in TEST() local
1763 e.events = EPOLLIN | EPOLLET; in TEST()
1764 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1766 e.events = EPOLLIN | EPOLLET; in TEST()
1767 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1773 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
1774 __sync_fetch_and_or(&ctx.count, 2); in TEST()
1777 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
1803 struct epoll_event e; in TEST() local
1816 e.events = EPOLLIN; in TEST()
1817 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1819 e.events = EPOLLIN; in TEST()
1820 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1829 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
1834 EXPECT_EQ(ctx.count, 2); in TEST()
1860 struct epoll_event e; in TEST() local
1873 e.events = EPOLLIN | EPOLLET; in TEST()
1874 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1876 e.events = EPOLLIN; in TEST()
1877 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1886 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
1887 __sync_fetch_and_or(&ctx.count, 2); in TEST()
1891 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
1917 struct epoll_event e; in TEST() local
1930 e.events = EPOLLIN; in TEST()
1931 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1933 e.events = EPOLLIN | EPOLLET; in TEST()
1934 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
1943 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
1948 EXPECT_EQ(ctx.count, 2); in TEST()
1974 struct epoll_event e; in TEST() local
1987 e.events = EPOLLIN | EPOLLET; in TEST()
1988 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
1990 e.events = EPOLLIN | EPOLLET; in TEST()
1991 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2000 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
2001 __sync_fetch_and_or(&ctx.count, 2); in TEST()
2005 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
2030 struct epoll_event e; in TEST() local
2043 e.events = EPOLLIN; in TEST()
2044 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2046 e.events = EPOLLIN; in TEST()
2047 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2053 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2057 EXPECT_EQ(ctx.count, 2); in TEST()
2082 struct epoll_event e; in TEST() local
2095 e.events = EPOLLIN | EPOLLET; in TEST()
2096 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2098 e.events = EPOLLIN; in TEST()
2099 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2105 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2106 __sync_fetch_and_or(&ctx.count, 2); in TEST()
2109 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
2134 struct epoll_event e; in TEST() local
2147 e.events = EPOLLIN; in TEST()
2148 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2150 e.events = EPOLLIN | EPOLLET; in TEST()
2151 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2157 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2161 EXPECT_EQ(ctx.count, 2); in TEST()
2186 struct epoll_event e; in TEST() local
2199 e.events = EPOLLIN | EPOLLET; in TEST()
2200 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2202 e.events = EPOLLIN | EPOLLET; in TEST()
2203 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2209 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2210 __sync_fetch_and_or(&ctx.count, 2); in TEST()
2213 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
2239 struct epoll_event e; in TEST() local
2252 e.events = EPOLLIN; in TEST()
2253 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2255 e.events = EPOLLIN; in TEST()
2256 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2265 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
2270 EXPECT_EQ(ctx.count, 2); in TEST()
2295 struct epoll_event e; in TEST() local
2308 e.events = EPOLLIN | EPOLLET; in TEST()
2309 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2311 e.events = EPOLLIN; in TEST()
2312 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2318 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2319 __sync_fetch_and_or(&ctx.count, 2); in TEST()
2322 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
2348 struct epoll_event e; in TEST() local
2361 e.events = EPOLLIN; in TEST()
2362 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2364 e.events = EPOLLIN | EPOLLET; in TEST()
2365 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2374 if (epoll_wait(ctx.efd[1], &e, 1, 0) > 0) in TEST()
2379 EXPECT_EQ(ctx.count, 2); in TEST()
2404 struct epoll_event e; in TEST() local
2417 e.events = EPOLLIN | EPOLLET; in TEST()
2418 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2420 e.events = EPOLLIN | EPOLLET; in TEST()
2421 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2427 if (epoll_wait(ctx.efd[1], &e, 1, -1) > 0) in TEST()
2428 __sync_fetch_and_or(&ctx.count, 2); in TEST()
2431 EXPECT_TRUE((ctx.count == 2) || (ctx.count == 3)); in TEST()
2457 struct epoll_event events[2]; in TEST()
2460 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
2468 efd[2] = epoll_create(1); in TEST()
2469 ASSERT_GE(efd[2], 0); in TEST()
2475 ASSERT_EQ(epoll_ctl(efd[2], EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
2481 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[2], events), 0); in TEST()
2486 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2487 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2491 close(efd[2]); in TEST()
2494 close(sfd[2]); in TEST()
2511 struct epoll_event events[2]; in TEST()
2514 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
2522 efd[2] = epoll_create(1); in TEST()
2523 ASSERT_GE(efd[2], 0); in TEST()
2529 ASSERT_EQ(epoll_ctl(efd[2], EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
2535 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[2], events), 0); in TEST()
2540 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2541 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 0); in TEST()
2545 close(efd[2]); in TEST()
2548 close(sfd[2]); in TEST()
2566 struct epoll_event events[2]; in TEST()
2569 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
2577 efd[2] = epoll_create(1); in TEST()
2578 ASSERT_GE(efd[2], 0); in TEST()
2584 ASSERT_EQ(epoll_ctl(efd[2], EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
2590 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[2], events), 0); in TEST()
2598 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2603 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2607 close(efd[2]); in TEST()
2610 close(sfd[2]); in TEST()
2628 struct epoll_event events[2]; in TEST()
2631 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &sfd[2]), 0); in TEST()
2639 efd[2] = epoll_create(1); in TEST()
2640 ASSERT_GE(efd[2], 0); in TEST()
2646 ASSERT_EQ(epoll_ctl(efd[2], EPOLL_CTL_ADD, sfd[2], events), 0); in TEST()
2652 ASSERT_EQ(epoll_ctl(efd[0], EPOLL_CTL_ADD, efd[2], events), 0); in TEST()
2660 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 2); in TEST()
2665 EXPECT_EQ(epoll_wait(efd[0], events, 2, 0), 0); in TEST()
2669 close(efd[2]); in TEST()
2672 close(sfd[2]); in TEST()
2688 struct epoll_event e; in TEST() local
2694 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
2702 ctx.efd[2] = epoll_create(1); in TEST()
2703 ASSERT_GE(ctx.efd[2], 0); in TEST()
2705 e.events = EPOLLIN; in TEST()
2706 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2708 e.events = EPOLLIN; in TEST()
2709 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
2711 e.events = EPOLLIN; in TEST()
2712 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2714 e.events = EPOLLIN; in TEST()
2715 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
2721 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
2725 EXPECT_EQ(ctx.count, 2); in TEST()
2734 close(ctx.efd[2]); in TEST()
2737 close(ctx.sfd[2]); in TEST()
2753 struct epoll_event e; in TEST() local
2759 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
2767 ctx.efd[2] = epoll_create(1); in TEST()
2768 ASSERT_GE(ctx.efd[2], 0); in TEST()
2770 e.events = EPOLLIN; in TEST()
2771 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2773 e.events = EPOLLIN; in TEST()
2774 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
2776 e.events = EPOLLIN | EPOLLET; in TEST()
2777 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2779 e.events = EPOLLIN | EPOLLET; in TEST()
2780 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
2786 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
2790 EXPECT_EQ(ctx.count, 2); in TEST()
2799 close(ctx.efd[2]); in TEST()
2802 close(ctx.sfd[2]); in TEST()
2818 struct epoll_event e; in TEST() local
2824 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
2832 ctx.efd[2] = epoll_create(1); in TEST()
2833 ASSERT_GE(ctx.efd[2], 0); in TEST()
2835 e.events = EPOLLIN; in TEST()
2836 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2838 e.events = EPOLLIN; in TEST()
2839 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
2841 e.events = EPOLLIN; in TEST()
2842 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2844 e.events = EPOLLIN; in TEST()
2845 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
2851 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
2855 EXPECT_EQ(ctx.count, 2); in TEST()
2864 close(ctx.efd[2]); in TEST()
2867 close(ctx.sfd[2]); in TEST()
2883 struct epoll_event e; in TEST() local
2889 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
2897 ctx.efd[2] = epoll_create(1); in TEST()
2898 ASSERT_GE(ctx.efd[2], 0); in TEST()
2900 e.events = EPOLLIN; in TEST()
2901 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2903 e.events = EPOLLIN; in TEST()
2904 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
2906 e.events = EPOLLIN | EPOLLET; in TEST()
2907 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2909 e.events = EPOLLIN | EPOLLET; in TEST()
2910 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
2916 if (epoll_wait(ctx.efd[0], &e, 1, -1) > 0) in TEST()
2920 EXPECT_EQ(ctx.count, 2); in TEST()
2929 close(ctx.efd[2]); in TEST()
2932 close(ctx.sfd[2]); in TEST()
2949 struct epoll_event e; in TEST() local
2955 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
2963 ctx.efd[2] = epoll_create(1); in TEST()
2964 ASSERT_GE(ctx.efd[2], 0); in TEST()
2966 e.events = EPOLLIN; in TEST()
2967 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
2969 e.events = EPOLLIN; in TEST()
2970 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
2972 e.events = EPOLLIN; in TEST()
2973 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
2975 e.events = EPOLLIN; in TEST()
2976 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
2985 if (epoll_wait(ctx.efd[0], &e, 1, 0) > 0) in TEST()
2990 EXPECT_EQ(ctx.count, 2); in TEST()
2999 close(ctx.efd[2]); in TEST()
3002 close(ctx.sfd[2]); in TEST()
3019 struct epoll_event e; in TEST() local
3025 ASSERT_EQ(socketpair(AF_UNIX, SOCK_STREAM, 0, &ctx.sfd[2]), 0); in TEST()
3033 ctx.efd[2] = epoll_create(1); in TEST()
3034 ASSERT_GE(ctx.efd[2], 0); in TEST()
3036 e.events = EPOLLIN; in TEST()
3037 ASSERT_EQ(epoll_ctl(ctx.efd[1], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
3039 e.events = EPOLLIN; in TEST()
3040 ASSERT_EQ(epoll_ctl(ctx.efd[2], EPOLL_CTL_ADD, ctx.sfd[2], &e), 0); in TEST()
3042 e.events = EPOLLIN | EPOLLET; in TEST()
3043 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[1], &e), 0); in TEST()
3045 e.events = EPOLLIN | EPOLLET; in TEST()
3046 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.efd[2], &e), 0); in TEST()
3055 if (epoll_wait(ctx.efd[0], &e, 1, 0) > 0) in TEST()
3060 EXPECT_EQ(ctx.count, 2); in TEST()
3069 close(ctx.efd[2]); in TEST()
3072 close(ctx.sfd[2]); in TEST()
3079 struct epoll_event e; in epoll59_thread() local
3086 e.events = EPOLLIN | EPOLLERR | EPOLLET; in epoll59_thread()
3087 epoll_ctl(ctx->efd[0], EPOLL_CTL_MOD, ctx->sfd[0], &e); in epoll59_thread()
3107 struct epoll_event e; in TEST() local
3119 e.events = EPOLLIN | EPOLLERR | EPOLLET; in TEST()
3120 ASSERT_EQ(epoll_ctl(ctx.efd[0], EPOLL_CTL_ADD, ctx.sfd[0], &e), 0); in TEST()
3125 ret = epoll_wait(ctx.efd[0], &e, 1, 1000); in TEST()
3155 struct epoll_event e; in epoll60_wait_thread() local
3179 ret = epoll_pwait(ctx->epfd, &e, 1, 2000, &sigmask); in epoll60_wait_thread()
3187 ret = read(e.data.fd, &v, sizeof(v)); in epoll60_wait_thread()
3218 struct epoll_event e; in TEST() local
3231 e.events = EPOLLIN | EPOLLET; in TEST()
3232 e.data.fd = ctx.evfd[i]; in TEST()
3233 ASSERT_EQ(epoll_ctl(ctx.epfd, EPOLL_CTL_ADD, ctx.evfd[i], &e), 0); in TEST()
3355 * Thread 2 calls epoll with a timeout of 11ms. in TEST()
3358 * The eventfd write by Thread 1 should either wakeup Thread 2 in TEST()
3359 * or Thread 3. If it wakes up Thread 2, Thread 2 writes on the in TEST()
3369 ASSERT_EQ(pthread_create(&threads[2], NULL, in TEST()