mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-06 18:54:14 +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();
|
return (int)GetLastError();
|
||||||
#else
|
#else
|
||||||
#if defined(__linux__) || defined(__gnu_linux__)
|
#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
|
/* 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. */
|
* tracks dirty pages and flushes ones as necessary. */
|
||||||
return MDBX_SUCCESS;
|
//
|
||||||
|
// 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 */
|
#endif /* Linux */
|
||||||
if (msync(ptr, length, (mode_bits & MDBX_SYNC_DATA) ? MS_SYNC : MS_ASYNC))
|
if (msync(ptr, length, (mode_bits & MDBX_SYNC_DATA) ? MS_SYNC : MS_ASYNC))
|
||||||
return errno;
|
return errno;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user