2 * Copyright (c) 2017-2018 The strace developers.
5 * SPDX-License-Identifier: LGPL-2.1-or-later
9 #include "print_fields.h"
14 #include "xlat/statx_masks.h"
15 #include "xlat/statx_attrs.h"
16 #include "xlat/at_statx_sync_types.h"
21 print_dirfd(tcp, tcp->u_arg[0]);
22 printpath(tcp, tcp->u_arg[1]);
25 unsigned int flags = tcp->u_arg[2];
26 printflags(at_statx_sync_types, flags & AT_STATX_SYNC_TYPE,
28 flags &= ~AT_STATX_SYNC_TYPE;
31 printflags(at_flags, flags, NULL);
35 printflags(statx_masks, tcp->u_arg[3], "STATX_???");
38 #define PRINT_FIELD_TIME(field) \
40 tprintf(", " #field "={tv_sec=%" PRId64 \
41 ", tv_nsec=%" PRIu32 "}", \
42 stx.field.sec, stx.field.nsec); \
43 tprints_comment(sprinttime_nsec(stx.field.sec, \
44 zero_extend_signed_to_ull(stx.field.nsec))); \
48 if (umove_or_printaddr(tcp, tcp->u_arg[4], &stx))
51 tprints("{stx_mask=");
52 printflags(statx_masks, stx.stx_mask, "STATX_???");
55 PRINT_FIELD_U(", ", stx, stx_blksize);
57 tprints(", stx_attributes=");
58 printflags(statx_attrs, stx.stx_attributes, "STATX_ATTR_???");
61 PRINT_FIELD_U(", ", stx, stx_nlink);
62 printuid(", stx_uid=", stx.stx_uid);
63 printuid(", stx_gid=", stx.stx_gid);
66 tprints(", stx_mode=");
67 print_symbolic_mode_t(stx.stx_mode);
70 PRINT_FIELD_U(", ", stx, stx_ino);
72 PRINT_FIELD_U(", ", stx, stx_size);
75 PRINT_FIELD_U(", ", stx, stx_blocks);
77 tprints(", stx_attributes_mask=");
78 printflags(statx_attrs, stx.stx_attributes_mask,
81 PRINT_FIELD_TIME(stx_atime);
82 PRINT_FIELD_TIME(stx_btime);
83 PRINT_FIELD_TIME(stx_ctime);
84 PRINT_FIELD_TIME(stx_mtime);
85 PRINT_FIELD_U(", ", stx, stx_rdev_major);
86 PRINT_FIELD_U(", ", stx, stx_rdev_minor);
87 PRINT_FIELD_U(", ", stx, stx_dev_major);
88 PRINT_FIELD_U(", ", stx, stx_dev_minor);