From 7b60363a3100c5eae3d15f34741a5fdad2b4903e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Thu, 13 Oct 2022 17:30:43 +0300 Subject: [PATCH] mdbx: fix builds with older libc versions after using `fcntl64()` (backport). --- ChangeLog.md | 7 +++++++ src/osal.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 9cba86b9..935254c3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,13 @@ ChangeLog --------- +## v0.11.x + +Fixes: + + - Fixed builds with older libc versions after using `fcntl64()` (backport). + + ## v0.11.12 (Эребуни) at 2022-10-12 The stable bugfix release. diff --git a/src/osal.h b/src/osal.h index 2b695196..4cd76f88 100644 --- a/src/osal.h +++ b/src/osal.h @@ -294,7 +294,14 @@ MDBX_MAYBE_UNUSED static __inline void mdbx_jitter4testing(bool tiny); #define MDBX_F_SETLK F_SETLK64 #define MDBX_F_SETLKW F_SETLKW64 #define MDBX_F_GETLK F_GETLK64 +#if (__GLIBC_PREREQ(2, 28) && \ + (defined(__USE_LARGEFILE64) || defined(__LARGEFILE64_SOURCE) || \ + defined(_USE_LARGEFILE64) || defined(_LARGEFILE64_SOURCE))) || \ + defined(fcntl64) #define MDBX_FCNTL fcntl64 +#else +#define MDBX_FCNTL fcntl +#endif #define MDBX_STRUCT_FLOCK struct flock64 #ifndef OFF_T_MAX #define OFF_T_MAX UINT64_C(0x7fffFFFFfff00000)