]> granicus.if.org Git - strace/blob - tests/epoll_create1.c
Update copyright headers
[strace] / tests / epoll_create1.c
1 /*
2  * Copyright (c) 2015-2018 Dmitry V. Levin <ldv@altlinux.org>
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  */
7
8 #include "tests.h"
9 #include <fcntl.h>
10 #include <asm/unistd.h>
11
12 #if defined __NR_epoll_create1 && defined O_CLOEXEC
13
14 # include <stdio.h>
15 # include <unistd.h>
16
17 int
18 main(void)
19 {
20         long rc = syscall(__NR_epoll_create1, O_CLOEXEC);
21         printf("epoll_create1(EPOLL_CLOEXEC) = %s\n", sprintrc(rc));
22
23         rc = syscall(__NR_epoll_create1, O_CLOEXEC | O_NONBLOCK);
24         printf("epoll_create1(EPOLL_CLOEXEC|%#x) = %s\n",
25                O_NONBLOCK, sprintrc(rc));
26
27         puts("+++ exited with 0 +++");
28         return 0;
29 }
30
31 #else
32
33 SKIP_MAIN_UNDEFINED("__NR_epoll_create1 && O_CLOEXEC")
34
35 #endif