File: 64-bit-time-t-compat.patch

package info (click to toggle)
gvm-libs 22.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,644 kB
  • sloc: ansic: 33,602; makefile: 26
file content (43 lines) | stat: -rw-r--r-- 1,360 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From: Steve Langasek <steve.langasek@canonical.com>
Date: Tue, 23 Apr 2024 14:31:25 +0200
Subject: wrap the write symbols when _FILE_OFFSET_BITS=64 is set

Forwarded: no
Last-Update: 2025-08-13

The setsockopt function in glibc is only used on 32-bit archs when LFS is
not enabled.  Support wrapping __setsockopt64 as well.
---
 boreas/CMakeLists.txt | 2 +-
 boreas/util_tests.c   | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/boreas/CMakeLists.txt b/boreas/CMakeLists.txt
index bfa6794..d2857a0 100644
--- a/boreas/CMakeLists.txt
+++ b/boreas/CMakeLists.txt
@@ -203,7 +203,7 @@ if(BUILD_TESTS)
     ${CMAKE_THREAD_LIBS_INIT}
   )
 
-  set(UTIL_TEST_LINKER_WRAP_OPTIONS "-Wl,-wrap,socket,-wrap,setsockopt")
+  set(UTIL_TEST_LINKER_WRAP_OPTIONS "-Wl,-wrap,socket,-wrap,setsockopt,-wrap,__setsockopt64")
   add_unit_test(
     util-test
     util_tests.c
diff --git a/boreas/util_tests.c b/boreas/util_tests.c
index 4703d4a..d0d6606 100644
--- a/boreas/util_tests.c
+++ b/boreas/util_tests.c
@@ -17,6 +17,11 @@ AfterEach (util)
 {
 }
 
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
+#define __real_setsockopt __real___setsockopt64
+#define __wrap_setsockopt __wrap___setsockopt64
+#endif
+
 __attribute__ ((weak)) int
 __real_socket (__attribute__ ((unused)) int domain,
                __attribute__ ((unused)) int type,