You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #561 (mmap module enablement, closing #301) added a build-system workaround for the absence of msync() in libposix:
configure.ac / configure: msync added to AC_CHECK_FUNCS.
pyconfig.h.in: #undef HAVE_MSYNC template entry.
Modules/mmapmodule.c:681: mmap.flush()'s call site gated on defined(HAVE_MSYNC), falling through to the existing ValueError("flush not supported on this system") path on platforms without msync.
This is a temporary divergence from upstream CPython, which calls msync() unconditionally on the UNIX branch. Once libposix exports msync() (tracked in nanvix/nanvix#2212), the guard becomes dead weight and the divergence should be removed.
Revert the Modules/mmapmodule.c portion of the second commit in PR Enable the mmap stdlib module on Nanvix #561 — remove && defined(HAVE_MSYNC) from the #elif so the call site matches upstream again.
Optional: drop msync from the AC_CHECK_FUNCS list and the #undef from pyconfig.h.in. Harmless to leave, but cleaner to remove the dead probe.
Add mmap.flush() to test_mmap coverage (which itself depends on adding test_mmap to NANVIX_TEST_LIST — separate concern).
Summary
PR #561 (mmap module enablement, closing #301) added a build-system workaround for the absence of
msync()in libposix:configure.ac/configure:msyncadded toAC_CHECK_FUNCS.pyconfig.h.in:#undef HAVE_MSYNCtemplate entry.Modules/mmapmodule.c:681:mmap.flush()'s call site gated ondefined(HAVE_MSYNC), falling through to the existingValueError("flush not supported on this system")path on platforms withoutmsync.This is a temporary divergence from upstream CPython, which calls
msync()unconditionally on theUNIXbranch. Once libposix exportsmsync()(tracked in nanvix/nanvix#2212), the guard becomes dead weight and the divergence should be removed.Action when nanvix/nanvix#2212 lands
.nanvix/nanvix.tomlto a version that includesmsync()../z setup, confirmpyconfig.hcontains#define HAVE_MSYNC 1.Modules/mmapmodule.cportion of the second commit in PR Enable the mmap stdlib module on Nanvix #561 — remove&& defined(HAVE_MSYNC)from the#elifso the call site matches upstream again.msyncfrom theAC_CHECK_FUNCSlist and the#undeffrompyconfig.h.in. Harmless to leave, but cleaner to remove the dead probe.mmap.flush()totest_mmapcoverage (which itself depends on addingtest_mmaptoNANVIX_TEST_LIST— separate concern).References
mmapstdlib module (memory-mapped file I/O) #301 — original mmap enablement issuemsync(2)implementation in libposix