diff --git a/rpcsx-os/ops.cpp b/rpcsx-os/ops.cpp index 001783109..7b34ddf1d 100644 --- a/rpcsx-os/ops.cpp +++ b/rpcsx-os/ops.cpp @@ -303,7 +303,21 @@ orbis::SysResult pwrite(orbis::Thread *thread, orbis::sint fd, } orbis::SysResult lseek(orbis::Thread *thread, orbis::sint fd, orbis::ulong offset, orbis::sint whence) { - return ErrorCode::NOTSUP; + Ref handle = + static_cast(thread->tproc->fileDescriptors.get(fd)); + if (handle == nullptr) { + return ErrorCode::BADF; + } + + auto result = handle->lseek(handle.get(), offset, whence); + + if (result < 0) { + // TODO + return ErrorCode::IO; + } + + thread->retval[0] = result; + return {}; } orbis::SysResult ftruncate(orbis::Thread *thread, orbis::sint fd, orbis::off_t length) {