mdbx-test: workaround for the ENOSPC from a tmpfs.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2025-08-24 09:03:54 +03:00
parent 466062151f
commit 109858b994

View File

@@ -1628,6 +1628,12 @@ int osal_fallocate(mdbx_filehandle_t fd, uint64_t length) {
if (fcntl(fd, F_PREALLOCATE, &store)) if (fcntl(fd, F_PREALLOCATE, &store))
err = ignore_enosys_and_eremote(errno); err = ignore_enosys_and_eremote(errno);
#endif /* Apple */ #endif /* Apple */
#if !defined(_WIN32) && !defined(_WIN64)
/* Workaround for testing: ignore ENOSPC for TMPFS/RAMFS.
* This is insignificant for production, but it helps in some tests using /dev/shm inside docker/containers. */
if (err == ENOSPC && osal_check_fs_incore(fd) == MDBX_RESULT_TRUE)
err = MDBX_RESULT_TRUE;
#endif /* !Windows */
return (err == MDBX_RESULT_TRUE) ? osal_ftruncate(fd, length) : err; return (err == MDBX_RESULT_TRUE) ? osal_ftruncate(fd, length) : err;
} }