Home | History | Annotate | Download | only in sys

Lines Matching defs:efd

52 	int	efd;
144 ATF_REQUIRE(eventfd_read(ctx->efd, &efd_value) == 0);
155 ATF_REQUIRE(eventfd_read(ctx->efd, &efd_value) == 0);
179 ATF_REQUIRE((ctx.efd = eventfd(0, 0)) >= 0);
195 ATF_REQUIRE(eventfd_write(ctx.efd, 0xcafebabe) == 0);
202 /* Test additive property of the efd value. */
203 ATF_REQUIRE(eventfd_write(ctx.efd, 0x0000cafe) == 0);
204 ATF_REQUIRE(eventfd_write(ctx.efd, 0xbeef0000) == 0);
215 (void) close(ctx.efd);
229 int efd;
231 ATF_REQUIRE((efd = eventfd(3, EFD_SEMAPHORE | EFD_NONBLOCK)) >= 0);
234 ATF_REQUIRE(eventfd_read(efd, &efd_value) == 0);
237 ATF_REQUIRE(eventfd_read(efd, &efd_value) == 0);
240 ATF_REQUIRE(eventfd_read(efd, &efd_value) == 0);
245 eventfd_read(efd, &efd_value) == -1);
248 ATF_REQUIRE(eventfd_write(efd, 1) == 0);
251 ATF_REQUIRE(eventfd_read(efd, &efd_value) == 0);
256 eventfd_read(efd, &efd_value) == -1);
258 (void) close(efd);
275 int efd;
279 ATF_REQUIRE((efd = eventfd(0, EFD_NONBLOCK)) >= 0);
282 EV_SET(&kev[0], efd, EVFILT_READ, EV_ADD, 0, 0, NULL);
283 EV_SET(&kev[1], efd, EVFILT_WRITE, EV_ADD, 0, 0, NULL);
287 * efd should be writable but not readable. Pass all of the
290 fds[0].fd = efd;
298 * As above; efd should only be set in writefds upon return
306 FD_SET(efd, &readfds);
307 FD_SET(efd, &writefds);
308 FD_SET(efd, &exceptfds);
309 ATF_REQUIRE(select(efd + 1, &readfds, &writefds, &exceptfds, &tv) == 1);
310 ATF_REQUIRE(!FD_ISSET(efd, &readfds));
311 ATF_REQUIRE(FD_ISSET(efd, &writefds));
312 ATF_REQUIRE(!FD_ISSET(efd, &exceptfds));
316 * on efd.
320 ATF_REQUIRE(kev[0].ident == (uintptr_t)efd);
329 ATF_REQUIRE(eventfd_write(efd, UINT64_MAX - 1) == 0);
331 fds[0].fd = efd;
343 FD_SET(efd, &readfds);
344 FD_SET(efd, &writefds);
345 FD_SET(efd, &exceptfds);
346 ATF_REQUIRE(select(efd + 1, &readfds, &writefds, &exceptfds, &tv) == 1);
347 ATF_REQUIRE(FD_ISSET(efd, &readfds));
348 ATF_REQUIRE(!FD_ISSET(efd, &writefds));
349 ATF_REQUIRE(!FD_ISSET(efd, &exceptfds));
353 * on efd.
357 ATF_REQUIRE(kev[0].ident == (uintptr_t)efd);
363 (void) close(efd);
378 fds[0].fd = ctx->efd;
383 eventfd_read(ctx->efd, &efd_value) == -1);
398 fds[0].fd = ctx->efd;
403 eventfd_write(ctx->efd, UINT64_MAX - 1) == -1);
419 FD_SET(ctx->efd, &selfds);
422 eventfd_read(ctx->efd, &efd_value) == -1);
427 ATF_REQUIRE(select(ctx->efd + 1, &selfds, NULL, NULL, NULL) == 1);
428 ATF_REQUIRE(FD_ISSET(ctx->efd, &selfds));
434 FD_SET(ctx->efd, &selfds);
437 eventfd_write(ctx->efd, UINT64_MAX - 1) == -1);
442 ATF_REQUIRE(select(ctx->efd + 1, NULL, &selfds, NULL, NULL) == 1);
443 ATF_REQUIRE(FD_ISSET(ctx->efd, &selfds));
453 EV_SET(&kev[0], ctx->efd, EVFILT_READ, EV_ADD | EV_ONESHOT, 0, 0, NULL);
457 eventfd_read(ctx->efd, &efd_value) == -1);
463 ATF_REQUIRE(kev[0].ident == (uintptr_t)ctx->efd);
471 EV_SET(&kev[0], ctx->efd, EVFILT_WRITE, EV_ADD | EV_ONESHOT, 0, 0,
476 eventfd_write(ctx->efd, UINT64_MAX - 1) == -1);
482 ATF_REQUIRE(kev[0].ident == (uintptr_t)ctx->efd);
510 ATF_REQUIRE((ctx.efd = eventfd(0, EFD_NONBLOCK)) >= 0);
529 ATF_REQUIRE(eventfd_write(ctx.efd, UINT64_MAX - 1) == 0);
550 ATF_REQUIRE(eventfd_read(ctx.efd, &efd_value) == 0);
572 ATF_REQUIRE(eventfd_write(ctx.efd, UINT64_MAX - 1) == 0);
593 ATF_REQUIRE(eventfd_read(ctx.efd, &efd_value) == 0);
615 ATF_REQUIRE(eventfd_write(ctx.efd, UINT64_MAX - 1) == 0);
636 ATF_REQUIRE(eventfd_read(ctx.efd, &efd_value) == 0);
648 (void) close(ctx.efd);
664 ATF_REQUIRE(eventfd_read(ctx->efd, &efd_value) == 0);
674 ATF_REQUIRE_ERRNO(EBADF, eventfd_read(ctx->efd, &efd_value) == -1);
696 ATF_REQUIRE((ctx.efd = eventfd(1, 0)) >= 0);
714 ATF_REQUIRE(close(ctx.efd) == 0);
751 int efd;
753 ATF_REQUIRE((efd = eventfd(1, EFD_NONBLOCK)) >= 0);
756 read(efd, efd_value, sizeof(efd_value[0]) - 1) == -1);
760 ATF_REQUIRE(read(efd, efd_value, sizeof(efd_value)) ==
766 write(efd, efd_value, sizeof(efd_value[0]) - 1) == -1);
767 ATF_REQUIRE(write(efd, efd_value, sizeof(efd_value)) ==
770 ATF_REQUIRE(read(efd, efd_value, sizeof(efd_value)) ==
775 (void) close(efd);
788 int efd;
791 ATF_REQUIRE((efd = eventfd(1, 0)) >= 0);
792 ATF_REQUIRE((fcntl(efd, F_GETFL) & O_NONBLOCK) == 0);
793 ATF_REQUIRE(fcntl(efd, F_SETFL, O_NONBLOCK) == 0);
794 ATF_REQUIRE((fcntl(efd, F_GETFL) & O_NONBLOCK) != 0);
795 ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) == 0);
797 ATF_REQUIRE(ioctl(efd, FIONREAD, &val) == 0);
800 ATF_REQUIRE(ioctl(efd, FIONWRITE, &val) == 0);
803 ATF_REQUIRE_ERRNO(ENOTTY, ioctl(efd, FIONSPACE, &val) == -1);
804 (void)close(efd);
806 ATF_REQUIRE((efd = eventfd(1, EFD_NONBLOCK | EFD_CLOEXEC)) >= 0);
807 ATF_REQUIRE((fcntl(efd, F_GETFL) & ~O_ACCMODE) == O_NONBLOCK);
808 ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) != 0);
809 ATF_REQUIRE(fcntl(efd, F_SETFD, 0) == 0);
810 ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) == 0);
811 ATF_REQUIRE(fcntl(efd, F_SETFD, FD_CLOEXEC) == 0);
812 ATF_REQUIRE((fcntl(efd, F_GETFD) & FD_CLOEXEC) != 0);
813 (void)close(efd);