]> granicus.if.org Git - strace/commitdiff
Introduce kernel_timespec32_t type
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 5 May 2019 22:28:34 +0000 (22:28 +0000)
Currently existing parsers of syscalls that deal with 32-bit timespec
rely upon struct timespec being defined in libc and match the definition
used by the kernel.  Given the upcoming y2038 changes in glibc,
this new type is going to be used instead.

* kernel_timespec.h: New file.
* Makefile.am (strace_SOURCES): Add it.

Makefile.am
kernel_timespec.h [new file with mode: 0644]

index b5946914a4f64b2a376b154da192441dc8fd2fdd..048e1229eb09c0ad8c16f63ef7e9dba76625cb08 100644 (file)
@@ -156,6 +156,7 @@ strace_SOURCES =    \
        ipc_shm.c       \
        ipc_shmctl.c    \
        kcmp.c          \
+       kernel_timespec.h \
        kernel_types.h  \
        kexec.c         \
        keyctl.c        \
diff --git a/kernel_timespec.h b/kernel_timespec.h
new file mode 100644 (file)
index 0000000..b86c8d6
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2019 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef STRACE_KERNEL_TIMESPEC_H
+# define STRACE_KERNEL_TIMESPEC_H
+
+# if HAVE_ARCH_TIME32_SYSCALLS
+
+typedef struct {
+       int tv_sec;
+       int tv_nsec;
+} kernel_timespec32_t;
+
+# endif /* HAVE_ARCH_TIME32_SYSCALLS */
+
+#endif /* !STRACE_KERNEL_TIMESPEC_H */