]> granicus.if.org Git - strace/blob - tests/tee.c
Remove XLAT_END
[strace] / tests / tee.c
1 /*
2  * This file is part of tee strace test.
3  *
4  * Copyright (c) 2016-2018 Dmitry V. Levin <ldv@altlinux.org>
5  * Copyright (c) 2016-2019 The strace developers.
6  * All rights reserved.
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10
11 #include "tests.h"
12 #include "scno.h"
13
14 #if defined __NR_tee
15
16 # include <stdio.h>
17 # include <unistd.h>
18
19 int
20 main(void)
21 {
22         const long int fd_in = (long int) 0xdeadbeefffffffffULL;
23         const long int fd_out = (long int) 0xdeadbeeffffffffeULL;
24         const size_t len = (size_t) 0xdeadbef3facefed3ULL;
25         const unsigned int flags = 15;
26
27         long rc = syscall(__NR_tee, fd_in, fd_out, len, flags);
28         printf("tee(%d, %d, %zu, %s) = %ld %s (%m)\n",
29                (int) fd_in, (int) fd_out, len,
30                "SPLICE_F_MOVE|SPLICE_F_NONBLOCK|SPLICE_F_MORE|SPLICE_F_GIFT",
31                rc, errno2name());
32
33         puts("+++ exited with 0 +++");
34         return 0;
35 }
36
37 #else
38
39 SKIP_MAIN_UNDEFINED("__NR_tee")
40
41 #endif