]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
testsuite: wrap _{l,}stat64_time64 in test
authorShengjing Zhu <shengjing.zhu@canonical.com>
Thu, 18 Apr 2024 14:29:51 +0000 (22:29 +0800)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 11 Jun 2024 12:43:27 +0000 (07:43 -0500)
Fix building with -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 on 32bit arch.

Closes: https://github.com/kmod-project/kmod/issues/37
Bug: https://bugs.debian.org/1065973
Co-authored-by: Jochen Sprickerhof <github@jochen.sprickerhof.de>
Signed-off-by: Shengjing Zhu <shengjing.zhu@canonical.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
testsuite/path.c

index 5a291b1be1b01decef5dd8675c3062b106a7f80c..00935fb50f61459d184614579b44e437f0e80bf2 100644 (file)
@@ -18,6 +18,7 @@
 /* We unset _FILE_OFFSET_BITS here so we can override both stat and stat64 on
  * 32-bit architectures and forward each to the right libc function */
 #undef _FILE_OFFSET_BITS
+#undef _TIME_BITS
 
 #include <assert.h>
 #include <dirent.h>
@@ -202,8 +203,14 @@ WRAP_2ARGS(int, -1, stat, struct stat*);
 WRAP_2ARGS(int, -1, lstat, struct stat*);
 WRAP_2ARGS(int, -1, stat64, struct stat64*);
 WRAP_2ARGS(int, -1, lstat64, struct stat64*);
-WRAP_OPEN(64);
 
+struct __stat64_t64;
+extern int __stat64_time64 (const char *file, struct __stat64_t64 *buf);
+extern int __lstat64_time64 (const char *file, struct __stat64_t64 *buf);
+WRAP_2ARGS(int, -1, __stat64_time64, struct __stat64_t64*);
+WRAP_2ARGS(int, -1, __lstat64_time64, struct __stat64_t64*);
+
+WRAP_OPEN(64);
 WRAP_OPEN();
 
 #ifdef HAVE___XSTAT