File: statx.c

package info (click to toggle)
strace 4.26-0.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 35,988 kB
  • sloc: ansic: 95,598; sh: 7,155; makefile: 2,489; awk: 335; perl: 267; sed: 6
file content (50 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (c) 2017-2018 The strace developers.
 * All rights reserved.
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#include "tests.h"
#include <asm/unistd.h>

#ifdef __NR_statx

# include <linux/stat.h>
# include "xlat.h"
# include "xlat/statx_masks.h"
# include "xlat/statx_attrs.h"
# include "xlat/at_statx_sync_types.h"

# define IS_STATX 1
# define TEST_SYSCALL_STR "statx"
# define STRUCT_STAT struct statx
# define STRUCT_STAT_STR "struct statx"
# define STRUCT_STAT_IS_STAT64 0

static unsigned    TEST_SYSCALL_STATX_FLAGS     = AT_STATX_SYNC_AS_STAT;
static const char *TEST_SYSCALL_STATX_FLAGS_STR = "AT_STATX_SYNC_AS_STAT";
static unsigned    TEST_SYSCALL_STATX_MASK      = STATX_ALL;
static const char *TEST_SYSCALL_STATX_MASK_STR  = "STATX_ALL";

# define TEST_SYSCALL_INVOKE(sample, pst) \
	syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \
		TEST_SYSCALL_STATX_MASK, pst)
# define PRINT_SYSCALL_HEADER(sample) \
	do { \
		int saved_errno = errno; \
		printf("%s(AT_FDCWD, \"%s\", %s, %s, ", \
		       TEST_SYSCALL_STR, sample, TEST_SYSCALL_STATX_FLAGS_STR, \
		       TEST_SYSCALL_STATX_MASK_STR)
# define PRINT_SYSCALL_FOOTER(rc) \
		errno = saved_errno; \
		printf(") = %s\n", sprintrc(rc)); \
	} while (0)

# include "xstatx.c"

#else

SKIP_MAIN_UNDEFINED("__NR_statx")

#endif