mdbx: require linux >= 4.0

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2022-09-18 13:21:38 +03:00
parent cf8540d84e
commit fe20de136c
2 changed files with 17 additions and 7 deletions

View File

@@ -937,9 +937,8 @@ MDBX_INTERNAL_FUNC int osal_fsync(mdbx_filehandle_t fd,
break /* error */;
#if defined(__linux__) || defined(__gnu_linux__)
case MDBX_SYNC_SIZE:
if (linux_kernel_version >= 0x03060000)
return MDBX_SUCCESS;
__fallthrough /* fall through */;
assert(linux_kernel_version >= 0x03060000);
return MDBX_SUCCESS;
#endif /* Linux */
#endif /* _POSIX_SYNCHRONIZED_IO > 0 */
default:
@@ -1076,10 +1075,10 @@ MDBX_INTERNAL_FUNC int osal_msync(osal_mmap_t *map, size_t offset,
return (int)GetLastError();
#else
#if defined(__linux__) || defined(__gnu_linux__)
if (mode_bits == MDBX_SYNC_NONE && linux_kernel_version > 0x02061300)
/* Since Linux 2.6.19, MS_ASYNC is in fact a no-op. The kernel properly
* tracks dirty pages and flushes them to storage as necessary. */
return MDBX_SUCCESS;
assert(linux_kernel_version > 0x02061300);
/* Since Linux 2.6.19, MS_ASYNC is in fact a no-op. The kernel properly
* tracks dirty pages and flushes them to storage as necessary. */
return MDBX_SUCCESS;
#endif /* Linux */
if (msync(ptr, length, (mode_bits & MDBX_SYNC_DATA) ? MS_SYNC : MS_ASYNC))
return errno;