From f2fd2280e4871babf8eceecdc9ff6fb85abd3cb0 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 23 Dec 2019 00:02:54 +0300 Subject: [PATCH] mdbx: more for QEMU cross-testing. Change-Id: Iad5e7f977c744b2edf1987d38523ba0e1f6e46ab --- src/elements/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/elements/core.c b/src/elements/core.c index ea9e8d63..798c3bc0 100644 --- a/src/elements/core.c +++ b/src/elements/core.c @@ -3920,7 +3920,7 @@ __cold static int mdbx_wipe_steady(MDBX_env *env, const txnid_t last_steady) { if (unlikely(err != MDBX_SUCCESS)) return err; } else { -#if defined(__linux__) || defined(__gnu_linux__) +#if (defined(__linux__) || defined(__gnu_linux__)) && !defined(MDBX_SAFE4QEMU) if (sync_file_range(env->me_lazy_fd, 0, pgno2bytes(env, NUM_METAS), SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER)) err = errno; @@ -14387,7 +14387,7 @@ static int __cold mdbx_env_copy_asis(MDBX_env *env, MDBX_txn *read_txn, buffer + roundup_powerof2(meta_bytes, env->me_os_psize); for (size_t offset = meta_bytes; rc == MDBX_SUCCESS && offset < used_size;) { if (dest_is_pipe) { -#if defined(__linux__) || defined(__gnu_linux__) +#if defined(__linux__) || defined(__gnu_linux__) && !defined(MDBX_SAFE4QEMU) off_t in_offset = offset; const intptr_t written = sendfile(fd, env->me_lazy_fd, &in_offset, used_size - offset); @@ -14399,7 +14399,7 @@ static int __cold mdbx_env_copy_asis(MDBX_env *env, MDBX_txn *read_txn, continue; #endif } else { -#if __GLIBC_PREREQ(2, 27) && defined(_GNU_SOURCE) +#if __GLIBC_PREREQ(2, 27) && defined(_GNU_SOURCE) && !defined(MDBX_SAFE4QEMU) off_t in_offset = offset, out_offset = offset; ssize_t bytes_copied = copy_file_range( env->me_lazy_fd, &in_offset, fd, &out_offset, used_size - offset, 0);