From 680124933e519458ac5063c6026293d1695b0a09 Mon Sep 17 00:00:00 2001 From: weitengchen Date: Tue, 23 Sep 2025 12:51:09 -0700 Subject: [PATCH] ignore MAP_SHARED --- litebox_shim_linux/src/syscalls/mm.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/litebox_shim_linux/src/syscalls/mm.rs b/litebox_shim_linux/src/syscalls/mm.rs index 03a12e502..02bb21f90 100644 --- a/litebox_shim_linux/src/syscalls/mm.rs +++ b/litebox_shim_linux/src/syscalls/mm.rs @@ -114,8 +114,7 @@ pub(crate) fn sys_mmap( return Err(Errno::EINVAL); } if flags.intersects( - MapFlags::MAP_SHARED - | MapFlags::MAP_32BIT + MapFlags::MAP_32BIT | MapFlags::MAP_GROWSDOWN | MapFlags::MAP_LOCKED | MapFlags::MAP_NONBLOCK @@ -128,6 +127,15 @@ pub(crate) fn sys_mmap( todo!("Unsupported flags {:?}", flags); } + if flags.contains(MapFlags::MAP_SHARED) { + #[cfg(debug_assertions)] + litebox::log_println!( + litebox_platform_multiplex::platform(), + "Warning: MAP_SHARED is not fully supported yet, changes are not reflected to the underlying file.", + ); + } + let flags = flags - MapFlags::MAP_SHARED; + let aligned_len = align_up(len, PAGE_SIZE); if aligned_len == 0 { return Err(Errno::ENOMEM);