#include "tests.h"
#include <fcntl.h>
-#include <sys/syscall.h>
+#include <asm/unistd.h>
#if defined __NR_epoll_create1 && defined O_CLOEXEC
-# include <assert.h>
-# include <errno.h>
# include <stdio.h>
# include <unistd.h>
int
main(void)
{
- int rc = syscall(__NR_epoll_create1, O_CLOEXEC);
- if (rc == -1) {
- if (ENOSYS != errno)
- perror_msg_and_fail("epoll_create1 O_CLOEXEC");
- printf("epoll_create1(EPOLL_CLOEXEC) = -1 ENOSYS (%m)\n");
- } else {
- printf("epoll_create1(EPOLL_CLOEXEC) = %d\n", rc);
- }
-
- assert(syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK) == -1);
- printf("epoll_create1(EPOLL_CLOEXEC|%#x) = -1 %s (%m)\n",
- O_NONBLOCK, ENOSYS == errno ? "ENOSYS" : "EINVAL");
+ long rc = syscall(__NR_epoll_create1, O_CLOEXEC);
+ printf("epoll_create1(EPOLL_CLOEXEC) = %s\n", sprintrc(rc));
+
+ rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK);
+ printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %s\n",
+ O_NONBLOCK, sprintrc(rc));
puts("+++ exited with 0 +++");
return 0;