FIX: AddrSpace dup handles must NOT be POSITIONED

AddrSpace handles from dup(b'empty') and dup(b'exclusive') use the write
syscall for mmap commands, not seekable I/O. The kwriteoff handler returns
the mapped address (not bytes written), which sys_write would incorrectly
add to the file offset when POSITIONED is set. This corrupted the offset,
causing the next write to fail with EINVAL (offset_word skip exhausted
the buffer). Only mmap-min-addr needs POSITIONED for actual read/write.
This commit is contained in:
2026-07-11 08:06:32 +03:00
parent 3322970697
commit 7b7db479f0
+2 -1
View File
@@ -1247,7 +1247,8 @@ impl KernelScheme for ProcScheme {
_ => return Err(Error::new(EINVAL)),
};
handle(Handle { context, kind }, true)
let positioned = !matches!(kind, ContextHandle::AddrSpace { .. });
handle(Handle { context, kind }, positioned)
}
_ => return Err(Error::new(EINVAL)),
},