Fix lseek(fd, -1, SEEK_SET) for XNA

This commit is contained in:
mailwl 2025-02-07 20:52:13 +03:00
parent cfe249debe
commit 806913baf5

View File

@ -317,6 +317,12 @@ s64 PS4_SYSV_ABI sceKernelLseek(int d, s64 offset, int whence) {
}
s64 PS4_SYSV_ABI posix_lseek(int d, s64 offset, int whence) {
// Workaround for XNA AudioEngine
if (whence == SEEK_SET && (s32)offset == -1) {
SetPosixErrno(EINVAL);
return offset;
}
s64 result = sceKernelLseek(d, offset, whence);
if (result < 0) {
LOG_ERROR(Kernel_Pthread, "posix_lseek: error = {}", result);