]> granicus.if.org Git - strace/commitdiff
Implement printers for kernel_timespec64_t
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 9 May 2019 22:03:30 +0000 (22:03 +0000)
They are going to be used to re-implement parsers of syscalls that deal
with 64-bit timespec, and to implement parsers of new *time64 syscalls.

* defs.h (print_timespec64_data_size, print_timespec64_array_data_size,
print_timespec64, sprint_timespec64, print_timespec64_utime_pair,
print_itimerspec64): New prototypes.
* print_timespec64.c: New file.
* Makefile.am (strace_SOURCES): Add it.

Makefile.am
defs.h
print_timespec64.c [new file with mode: 0644]

index 3177b8241de78f5d22622b3cf21e26f29b7d179e..6bcfa94a6de5ecefb6f8ee445d96b80d90b3e681 100644 (file)
@@ -245,6 +245,7 @@ strace_SOURCES =    \
        print_timespec.c \
        print_timespec.h \
        print_timespec32.c \
+       print_timespec64.c \
        print_timeval.c \
        print_timex.c   \
        print_utils.h   \
diff --git a/defs.h b/defs.h
index b723cb88ba4b406894ccc47ce6368202521dd02d..e7969ccce061e12360ab15a515132f6ac12d4085 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -1120,6 +1120,15 @@ extern int print_timespec32_utime_pair(struct tcb *, kernel_ulong_t);
 extern int print_itimerspec32(struct tcb *, kernel_ulong_t);
 # endif /* HAVE_ARCH_TIME32_SYSCALLS */
 
+extern bool print_timespec64_data_size(const void *arg, size_t size);
+extern bool print_timespec64_array_data_size(const void *arg,
+                                            unsigned int nmemb,
+                                            size_t size);
+extern int print_timespec64(struct tcb *, kernel_ulong_t);
+extern const char *sprint_timespec64(struct tcb *, kernel_ulong_t);
+extern int print_timespec64_utime_pair(struct tcb *, kernel_ulong_t);
+extern int print_itimerspec64(struct tcb *, kernel_ulong_t);
+
 # ifdef ALPHA
 typedef struct {
        int tv_sec, tv_usec;
diff --git a/print_timespec64.c b/print_timespec64.c
new file mode 100644 (file)
index 0000000..3a9732c
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "defs.h"
+
+#define TIMESPEC_T kernel_timespec64_t
+#define PRINT_TIMESPEC_DATA_SIZE print_timespec64_data_size
+#define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec64_array_data_size
+#define PRINT_TIMESPEC print_timespec64
+#define SPRINT_TIMESPEC sprint_timespec64
+#define PRINT_TIMESPEC_UTIME_PAIR print_timespec64_utime_pair
+#define PRINT_ITIMERSPEC print_itimerspec64
+
+#include "kernel_timespec.h"
+#include "print_timespec.h"