blob: 01bbe8ef3b15d9e03bf8707ea00a9f009cbc9fed [file] [log] [blame]
Fei Jiec75e2c22016-04-08 15:59:16 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#if defined __NR_epoll_wait && defined HAVE_SYS_EPOLL_H
5
6# include <errno.h>
7# include <stdio.h>
8# include <sys/epoll.h>
9# include <unistd.h>
10
11int
12main(void)
13{
14 struct epoll_event *const ev = tail_alloc(sizeof(*ev));
15
Dmitry V. Levin33568cf2016-04-21 20:38:15 +000016 long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2);
17 printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n",
Dmitry V. Levin9f6611b2016-04-21 17:49:32 +000018 ev, rc, errno2name());
Fei Jiec75e2c22016-04-08 15:59:16 +080019
20 puts("+++ exited with 0 +++");
21 return 0;
22}
23
24#else
25
26SKIP_MAIN_UNDEFINED("__NR_epoll_wait && HAVE_SYS_EPOLL_H")
27
28#endif