summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch')
-rw-r--r--meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch43
1 files changed, 0 insertions, 43 deletions
diff --git a/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch b/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
deleted file mode 100644
index 58a6c0d8a0..0000000000
--- a/meta/recipes-core/busybox/busybox/0001-time-Use-64-prefix-syscall-if-we-have-to.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From 902d3992922fc8db8495d5fb30a4581711b60c62 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Wed, 18 Sep 2019 09:28:50 -0700
4Subject: [PATCH] time: Use 64 prefix syscall if we have to
5
6Some 32-bit architectures no longer have the 32-bit time_t syscalls.
7Instead they have suffixed syscalls that returns a 64-bit time_t. If
8the architecture doesn't have the non-suffixed syscall and is using a
964-bit time_t let's use the suffixed syscall instead.
10
11This fixes build issues when building for RISC-V 32-bit with 5.1+ kernel
12headers.
13
14If an architecture only supports the suffixed syscalls, but is still
15using a 32-bit time_t report a compilation error. This avoids us have to
16deal with converting between 64-bit and 32-bit values. There are
17currently no architectures where this is the case.
18
19Upstream-Status: Backport [https://git.busybox.net/busybox/commit/?id=902d3992922fc8db8495d5fb30a4581711b60c62]
20Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
21Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
22---
23 libbb/time.c | 7 +++++++
24 1 file changed, 7 insertions(+)
25
26--- a/libbb/time.c
27+++ b/libbb/time.c
28@@ -257,7 +257,14 @@ char* FAST_FUNC strftime_YYYYMMDDHHMMSS(
29 * typically requiring -lrt. We just skip all this mess */
30 static void get_mono(struct timespec *ts)
31 {
32- if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
33+#if defined(__NR_clock_gettime)
34+ if (syscall(__NR_clock_gettime, CLOCK_MONOTONIC, ts))
35+#elif __TIMESIZE == 64
36+ if (syscall(__NR_clock_gettime64, CLOCK_MONOTONIC, ts))
37+#else
38+# error "We currently don't support architectures without " \
39+ "the __NR_clock_gettime syscall and 32-bit time_t"
40+#endif
41 bb_error_msg_and_die("clock_gettime(MONOTONIC) failed");
42 }
43 unsigned long long FAST_FUNC monotonic_ns(void)