2 #include <asm/unistd.h>
8 # include <sys/epoll.h>
12 invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev)
14 op |= (unsigned long) 0xffffffff00000000ULL;
15 return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev);
21 struct epoll_event *const ev = tail_alloc(sizeof(*ev));
24 long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev);
25 printf("epoll_ctl(-1, EPOLL_CTL_ADD, -2, {EPOLLIN,"
26 " {u32=%u, u64=%" PRIu64 "}}) = %ld %s (%m)\n",
27 ev->data.u32, ev->data.u64, rc, errno2name());
29 rc = invoke_syscall(-3U, EPOLL_CTL_DEL, -4U, ev);
30 printf("epoll_ctl(-3, EPOLL_CTL_DEL, -4, %p) = %ld %s (%m)\n",
31 ev, rc, errno2name());
33 rc = invoke_syscall(-1UL, EPOLL_CTL_MOD, -16UL, 0);
34 printf("epoll_ctl(-1, EPOLL_CTL_MOD, -16, NULL) = %ld %s (%m)\n",
37 puts("+++ exited with 0 +++");
43 SKIP_MAIN_UNDEFINED("__NR_epoll_ctl")