FIX: sys_read/sys_write must pass u64::MAX for non-positioned I/O
The default kreadoff/kwriteoff implementations in scheme/mod.rs require offset=u64::MAX for stream (non-positioned) I/O. Passing offset=0 causes ESPIPE (Illegal seek), which breaks ALL writes to non-positioned FDs including Debug/stdout. This was the root cause of the procmgr child appearing to 'panic' — its log output silently failed with ESPIPE.
This commit is contained in:
+2
-2
@@ -832,7 +832,7 @@ pub fn sys_read(fd: FileHandle, buf: UserSliceWo, token: &mut CleanLockToken) ->
|
||||
let offset = if desc.internal_flags.contains(InternalFlags::POSITIONED) {
|
||||
desc.offset
|
||||
} else {
|
||||
0
|
||||
u64::MAX
|
||||
};
|
||||
Ok((
|
||||
scheme.kreadoff(desc.number, buf, offset, desc.flags, desc.flags, token)?,
|
||||
@@ -861,7 +861,7 @@ pub fn sys_write(fd: FileHandle, buf: UserSliceRo, token: &mut CleanLockToken) -
|
||||
let offset = if desc.internal_flags.contains(InternalFlags::POSITIONED) {
|
||||
desc.offset
|
||||
} else {
|
||||
0
|
||||
u64::MAX
|
||||
};
|
||||
Ok((
|
||||
scheme.kwriteoff(desc.number, buf, offset, desc.flags, desc.flags, token)?,
|
||||
|
||||
Reference in New Issue
Block a user