2 * This file is part of copy_file_range strace test.
4 * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
5 * Copyright (c) 2016-2017 The strace developers.
8 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include <asm/unistd.h>
15 #if defined __NR_copy_file_range
23 const long int fd_in = (long int) 0xdeadbeefffffffff;
24 const long int fd_out = (long int) 0xdeadbeeffffffffe;
25 TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in);
26 TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out);
27 *off_in = 0xdeadbef1facefed1;
28 *off_out = 0xdeadbef2facefed2;
29 const size_t len = (size_t) 0xdeadbef3facefed3ULL;
30 const unsigned int flags = 0;
32 long rc = syscall(__NR_copy_file_range,
33 fd_in, off_in, fd_out, off_out, len, flags);
34 printf("copy_file_range(%d, [%lld], %d, [%lld], %zu, %u)"
36 (int) fd_in, *off_in, (int) fd_out, *off_out, len, flags,
39 puts("+++ exited with 0 +++");
45 SKIP_MAIN_UNDEFINED("__NR_copy_file_range")