]> granicus.if.org Git - strace/commitdiff
Update statx parser and syscall entries lists to the upstream
authorVictor Krapivensky <krapivenskiy.va@phystech.edu>
Sat, 15 Apr 2017 08:43:12 +0000 (11:43 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 15 Apr 2017 13:25:57 +0000 (13:25 +0000)
* linux/32/syscallent.h [291]: Add statx entry.
* linux/64/syscallent.h [291]: Likewise.
* linux/arm/syscallent.h [397]: Likewise.
* linux/m68k/syscallent.h [379]: Likewise.
* linux/mips/syscallent-n32.h [6330]: Likewise.
* linux/mips/syscallent-n64.h [5326]: Likewise.
* linux/mips/syscallent-o32.h [4366]: Likewise.
* linux/powerpc/syscallent.h [383]: Likewise.
* linux/s390/syscallent.h [379]: Likewise.
* linux/s390x/syscallent.h [379]: Likewise.
* linux/xtensa/syscallent.h [351]: Likewise.
* statx.h (struct_statx): Update.
* statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask.
* tests/xstatx.c (print_stat, main): Update to test decoding
of struct_statx.stx_attributes_mask.

14 files changed:
linux/32/syscallent.h
linux/64/syscallent.h
linux/arm/syscallent.h
linux/m68k/syscallent.h
linux/mips/syscallent-n32.h
linux/mips/syscallent-n64.h
linux/mips/syscallent-o32.h
linux/powerpc/syscallent.h
linux/s390/syscallent.h
linux/s390x/syscallent.h
linux/xtensa/syscallent.h
statx.c
statx.h
tests/xstatx.c

index c5457e9e6a0fd92a359103e2fc6204aea87774c6..7b609cbf48aee3ce3016b23741d242c14d11567e 100644 (file)
 [288] = { 4,   TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [289] = { 2,   0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [290] = { 1,   0,              SEN(pkey_free),                 "pkey_free"             },
+[291] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #undef sys_ARCH_mmap
 #undef ARCH_WANT_SYNC_FILE_RANGE2
index 2575c584cbf5df089d7cd09664bd27a8ec2cc4c9..d137d2460fa2488d7ac18cf368d5949d8128cf9b 100644 (file)
 [288] = { 4,   TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [289] = { 2,   0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [290] = { 1,   0,              SEN(pkey_free),                 "pkey_free"             },
+[291] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
index d404355bcf04cb897199aca789818f40328ecee0..a74d7ac5bf7fa94a60fa4de260c9e2c9f45e0acf 100644 (file)
 [394] = { 4,   TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [395] = { 2,   0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [396] = { 1,   0,              SEN(pkey_free),                 "pkey_free"             },
+[397] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #ifdef __ARM_EABI__
 # define ARM_FIRST_SHUFFLED_SYSCALL 400
index cd61a37c34496c60874120322247033f3960830b..abde584bb0d43affbd98cb7bb83af54bee2c380c 100644 (file)
 [376] = { 6,   TD,             SEN(copy_file_range),           "copy_file_range"       },
 [377] = { 6,   TD,             SEN(preadv2),                   "preadv2"               },
 [378] = { 6,   TD,             SEN(pwritev2),                  "pwritev2"              },
+[379] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #define SYS_socket_subcall     400
 #include "subcall.h"
index 7ff61a1a871ff5c0e99a005df9d3ef408e6ca10c..5d5ce9c230f4beee7d1f94c6267f94a5ce46eaa3 100644 (file)
 [6327] = { 4,  TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [6328] = { 2,  0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [6329] = { 1,  0,              SEN(pkey_free),                 "pkey_free"             },
+[6330] = { 5,  TD|TF,          SEN(statx),                     "statx"                 },
 
 # define SYS_socket_subcall      6400
 # include "subcall.h"
index 4079c64de612d0b99b8f1bfe76efa463d5663a9d..271c7be6dd0d81544fa3aa210bd3132133792f04 100644 (file)
 [5323] = { 4,  TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [5324] = { 2,  0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [5325] = { 1,  0,              SEN(pkey_free),                 "pkey_free"             },
+[5326] = { 5,  TD|TF,          SEN(statx),                     "statx"                 },
 
 # define SYS_socket_subcall      5400
 # include "subcall.h"
index e0943552f813e6359a91f7b464cd82c90ecb1a83..1ba14935bdd142355d286874464da0f543ed5bc4 100644 (file)
 [4363] = { 4,  TM|SI,          SEN(pkey_mprotect),             "pkey_mprotect"         },
 [4364] = { 2,  0,              SEN(pkey_alloc),                "pkey_alloc"            },
 [4365] = { 1,  0,              SEN(pkey_free),                 "pkey_free"             },
+[4366] = { 5,  TD|TF,          SEN(statx),                     "statx"                 },
 
 # define SYS_socket_subcall      4400
 # include "subcall.h"
index 3bcb79d10d51c0b92b67fac0cae30ef244197285..dc8be61386dc22139c3a2679fb6e491e3673295a 100644 (file)
 [380] = { 6,   TD,             SEN(preadv2),                   "preadv2"               },
 [381] = { 6,   TD,             SEN(pwritev2),                  "pwritev2"              },
 [382] = { 5,   TD,             SEN(kexec_file_load),           "kexec_file_load"       },
+[383] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #define SYS_socket_subcall     400
 #include "subcall.h"
index a3fd6f838a0a920a43bc3671d5f34dc1c5615f04..805756dfbabab528b0034b49605d8c3a4991d5ad 100644 (file)
 [375] = { 6,   TD,             SEN(copy_file_range),           "copy_file_range"       },
 [376] = { 6,   TD,             SEN(preadv2),                   "preadv2"               },
 [377] = { 6,   TD,             SEN(pwritev2),                  "pwritev2"              },
+[378] = { },
+[379] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #define SYS_socket_subcall     400
 #include "subcall.h"
index 6179f346e30841b870cf52c5a70dd97877d7a8ba..67fb0ee008c543fb4a88767d4b3695156c5a7c46 100644 (file)
 [375] = { 6,   TD,             SEN(copy_file_range),           "copy_file_range"       },
 [376] = { 6,   TD,             SEN(preadv2),                   "preadv2"               },
 [377] = { 6,   TD,             SEN(pwritev2),                  "pwritev2"              },
+[378] = { },
+[379] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
 
 #define SYS_socket_subcall     400
 #include "subcall.h"
index dd8e3b59e2e1b7c5336453a9ce8b984707980ecb..43b8c5fd6fa27aa9e9400da977850b6fb2d19107 100644 (file)
 [345] = { 6,   TD,             SEN(copy_file_range),           "copy_file_range"       },
 [346] = { 6,   TD,             SEN(preadv2),                   "preadv2"               },
 [347] = { 6,   TD,             SEN(pwritev2),                  "pwritev2"              },
+[348 ... 350] = { },
+[351] = { 5,   TD|TF,          SEN(statx),                     "statx"                 },
diff --git a/statx.c b/statx.c
index 7c647fa304fead412f1dd99fe38785af72f475ac..c53f29c27864e0a428e71b4426612435ec98d0e0 100644 (file)
--- a/statx.c
+++ b/statx.c
@@ -94,6 +94,11 @@ SYS_FUNC(statx)
 
                if (!abbrev(tcp)) {
                        PRINT_FIELD_U(stx_blocks);
+
+                       tprints(", stx_attributes_mask=");
+                       printflags(statx_attrs, stx.stx_attributes_mask,
+                                  "STATX_ATTR_???");
+
                        PRINT_FIELD_TIME(stx_atime);
                        PRINT_FIELD_TIME(stx_btime);
                        PRINT_FIELD_TIME(stx_ctime);
diff --git a/statx.h b/statx.h
index d946291a810ebc5c301b47db1625cf8a5f6e2c79..203728704534b2f52606f09c5d1424c495e132be 100644 (file)
--- a/statx.h
+++ b/statx.h
@@ -51,7 +51,8 @@ typedef struct {
        uint64_t stx_ino; /* Inode number */
        uint64_t stx_size; /* File size */
        uint64_t stx_blocks; /* Number of 512-byte blocks allocated */
-       uint64_t reserved1[1];
+       uint64_t stx_attributes_mask; /* Mask to show what's supported in
+                                        stx_attributes */
 
        struct_statx_timestamp stx_atime; /* Last access time */
        struct_statx_timestamp stx_btime; /* File creation time */
index 774aae00ccbc6d5a5addd2f518e5d5084d428361..f4e1a90f2fa8fb21f0079f175f916abac0ce438f 100644 (file)
@@ -224,6 +224,10 @@ print_stat(const STRUCT_STAT *st)
        PRINT_FIELD_U(stx_ino);
        PRINT_FIELD_U(stx_size);
        PRINT_FIELD_U(stx_blocks);
+
+       printf(", stx_attributes_mask=");
+       printflags(statx_attrs, st->stx_attributes_mask, "STATX_ATTR_???");
+
        PRINT_FIELD_TIME(stx_atime);
        PRINT_FIELD_TIME(stx_btime);
        PRINT_FIELD_TIME(stx_ctime);
@@ -338,6 +342,7 @@ main(void)
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ino);
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_size);
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blocks);
+               LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes_mask);
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_atime);
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_btime);
                LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ctime);