mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-01 23:54:12 +08:00
mdbx: fix nasty typo/rebase/merge bug with calling msync()
on Linux.
This commit is contained in:
parent
4a257133cb
commit
c46c03e7c8
11
src/osal.c
11
src/osal.c
@ -1706,10 +1706,15 @@ MDBX_INTERNAL_FUNC int osal_msync(const osal_mmap_t *map, size_t offset,
|
||||
return (int)GetLastError();
|
||||
#else
|
||||
#if defined(__linux__) || defined(__gnu_linux__)
|
||||
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;
|
||||
* tracks dirty pages and flushes ones as necessary. */
|
||||
//
|
||||
// However, this behavior may be changed in custom kernels,
|
||||
// so just leave such optimization to the libc discretion.
|
||||
//
|
||||
// assert(linux_kernel_version > 0x02061300);
|
||||
// if (mode_bits == MDBX_SYNC_NONE)
|
||||
// return MDBX_SUCCESS;
|
||||
#endif /* Linux */
|
||||
if (msync(ptr, length, (mode_bits & MDBX_SYNC_DATA) ? MS_SYNC : MS_ASYNC))
|
||||
return errno;
|
||||
|
Loading…
x
Reference in New Issue
Block a user