AnyPS5/core/libs/prx/libkernel/File/src
Raihan Abdul Majid e768d97949 fix(kernel): keep the file offset in Windows AIO reads and writes
Each Windows AIO request is an overlapped ReadFile/WriteFile at the
request's offset, which on a synchronous handle also moves the
descriptor's file pointer; on the console AIO transfers leave it alone.
The requests now go through the positioned path sceKernelPread and
sceKernelPwrite use (NativePositioned in Stdio.cpp, exposed as
NativePositioned_nid_no_patch), which restores the pointer afterwards.
Negative offsets still fail with EINVAL before the transfer.

GuestAio sets the offset to 2 before a write batch and checks it is
still 2 after. TechnicalDebt records that a concurrent read or write on
the same descriptor can see the moved pointer in between, as for the
pread family.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UTjpbMX7BUFMZZaxJE98zV
2026-10-10 00:22:22 +02:00
..
DirectoryDescriptor.cpp fix(libkernel): report undersized Windows directory buffers 2026-10-01 23:24:41 +02:00
NativeStat.cpp feat(libkernel): implement lstat 2026-10-09 17:30:43 -04:00
Open.cpp fix(libkernel): flush only the paths the guest changed in sceKernelSync on Windows 2026-10-08 08:27:22 +00:00
Stdio.cpp fix(kernel): keep the file offset in Windows AIO reads and writes 2026-10-10 00:22:22 +02:00
Terminal.cpp feat(libkernel): implement tcgetattr and tcsetattr 2026-10-09 23:17:12 +02:00