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]);
23 printpath(tcp, tcp->u_arg[1]);
26 unsigned int flags = tcp->u_arg[2];
27 printflags(at_statx_sync_types, flags & AT_STATX_SYNC_TYPE,
29 flags &= ~AT_STATX_SYNC_TYPE;
32 printflags(at_flags, flags, NULL);
36 printflags(statx_masks, tcp->u_arg[3], "STATX_???");
39 #define PRINT_FIELD_TIME(field) \
41 tprintf(", " #field "={tv_sec=%" PRId64 \
42 ", tv_nsec=%" PRIu32 "}", \
43 stx.field.sec, stx.field.nsec); \
44 tprints_comment(sprinttime_nsec(stx.field.sec, \
45 zero_extend_signed_to_ull(stx.field.nsec))); \
49 if (umove_or_printaddr(tcp, tcp->u_arg[4], &stx))
52 tprints("{stx_mask=");
53 printflags(statx_masks, stx.stx_mask, "STATX_???");
56 PRINT_FIELD_U(", ", stx, stx_blksize);
58 tprints(", stx_attributes=");
59 printflags(statx_attrs, stx.stx_attributes, "STATX_ATTR_???");
62 PRINT_FIELD_U(", ", stx, stx_nlink);
63 printuid(", stx_uid=", stx.stx_uid);
64 printuid(", stx_gid=", stx.stx_gid);
67 tprints(", stx_mode=");
68 print_symbolic_mode_t(stx.stx_mode);
71 PRINT_FIELD_U(", ", stx, stx_ino);
73 PRINT_FIELD_U(", ", stx, stx_size);
76 PRINT_FIELD_U(", ", stx, stx_blocks);
78 tprints(", stx_attributes_mask=");
79 printflags(statx_attrs, stx.stx_attributes_mask,
82 PRINT_FIELD_TIME(stx_atime);
83 PRINT_FIELD_TIME(stx_btime);
84 PRINT_FIELD_TIME(stx_ctime);
85 PRINT_FIELD_TIME(stx_mtime);
86 PRINT_FIELD_U(", ", stx, stx_rdev_major);
87 PRINT_FIELD_U(", ", stx, stx_rdev_minor);
88 PRINT_FIELD_U(", ", stx, stx_dev_major);
89 PRINT_FIELD_U(", ", stx, stx_dev_minor);