summaryrefslogtreecommitdiff
path: root/sys-apps/file/files/file-5.45-32-bit-time_t-deux.patch
blob: 8c1e0934145c77ea4c697c8f0de4feec1b789be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
https://github.com/file/file/commit/8dc5513908381a14981b16a85d59ba054bf4df52

From 8dc5513908381a14981b16a85d59ba054bf4df52 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Mon, 31 Jul 2023 15:56:12 +0000
Subject: [PATCH] Check if we support _TIME_BITS. (Werner Fink)

--- a/configure.ac
+++ b/configure.ac
@@ -152,6 +152,18 @@ AC_TYPE_UINT64_T
 AC_TYPE_INT64_T
 AC_TYPE_INTPTR_T
 AC_TYPE_UINTPTR_T
+m4_ifdef([AC_SYS_YEAR2038], [AC_SYS_YEAR2038], [
+# GNU libc only allows setting _TIME_BITS when FILE_OFFSET_BITS is also set.
+# GNU libc defines __TIMESIZE on systems where _TIME_BITS can be set.
+AS_IF([test X"$ac_cv_sys_file_offset_bits" = X"64"], [
+    AC_CHECK_DECL(__TIMESIZE, [
+	AC_DEFINE([_TIME_BITS], [64], [Number of bits in a timestamp, on hosts where this is settable.])
+    ], [], [
+AC_INCLUDES_DEFAULT
+#include <time.h>
+	])
+    ])
+])
 AC_FUNC_MMAP
 AC_FUNC_FORK
 AC_FUNC_MBRTOWC