2 * Copyright (c) 2017 The strace developers.
5 * SPDX-License-Identifier: GPL-2.0-or-later
9 #include <asm/unistd.h>
13 # include <linux/stat.h>
15 # include "xlat/statx_masks.h"
16 # include "xlat/statx_attrs.h"
17 # include "xlat/at_statx_sync_types.h"
20 # define TEST_SYSCALL_STR "statx"
21 # define STRUCT_STAT struct statx
22 # define STRUCT_STAT_STR "struct statx"
23 # define STRUCT_STAT_IS_STAT64 0
25 static unsigned TEST_SYSCALL_STATX_FLAGS = AT_STATX_SYNC_AS_STAT;
26 static const char *TEST_SYSCALL_STATX_FLAGS_STR = "AT_STATX_SYNC_AS_STAT";
27 static unsigned TEST_SYSCALL_STATX_MASK = STATX_ALL;
28 static const char *TEST_SYSCALL_STATX_MASK_STR = "STATX_ALL";
30 # define TEST_SYSCALL_INVOKE(sample, pst) \
31 syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \
32 TEST_SYSCALL_STATX_MASK, pst)
33 # define PRINT_SYSCALL_HEADER(sample) \
35 int saved_errno = errno; \
36 printf("%s(AT_FDCWD, \"%s\", %s, %s, ", \
37 TEST_SYSCALL_STR, sample, TEST_SYSCALL_STATX_FLAGS_STR, \
38 TEST_SYSCALL_STATX_MASK_STR)
39 # define PRINT_SYSCALL_FOOTER(rc) \
40 errno = saved_errno; \
41 printf(") = %s\n", sprintrc(rc)); \
48 SKIP_MAIN_UNDEFINED("__NR_statx")