mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-23 09:03:22 -05:00
Add the guest socket descriptor guard to sceKernelFdatasync before any native syscall, matching the existing sceKernelFchmod pattern. This prevents high guest socket descriptors (e.g. 0x10000000) from reaching the Windows CRT _commit, which would trigger the invalid-parameter handler, and ensures the correct SCE error is returned on all platforms. Refactor fdatasync_nid_postfix to delegate to sceKernelFdatasync via PosixResult, removing the duplicated socket guard and native syscall. Extend GuestFilesystem tests to cover: - sceKernelFdatasync on a valid guest socket returns SCE EINVAL (0x80020016) - sceKernelFdatasync on a closed guest socket returns SCE EBADF (0x80020009) - sceKernelFdatasync on a high invalid descriptor (0x7fffffff) returns SCE EBADF - closed-ordinary-descriptor tests now run on Windows (verified _commit on a closed descriptor returns EBADF without provoking the CRT handler)