From 95a386308a8d93b0a5a40584126fa859a4fe89e9 Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Sun, 20 Jul 2025 21:52:44 +0200 Subject: [PATCH] Implement sceKernelError (#3282) * Implement sceKernelError * Oh come on --- src/core/libraries/kernel/kernel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/libraries/kernel/kernel.cpp b/src/core/libraries/kernel/kernel.cpp index 3272e8727..e18a91d05 100644 --- a/src/core/libraries/kernel/kernel.cpp +++ b/src/core/libraries/kernel/kernel.cpp @@ -91,6 +91,13 @@ s32 ErrnoToSceKernelError(s32 error) { return error + ORBIS_KERNEL_ERROR_UNKNOWN; } +s32 PS4_SYSV_ABI sceKernelError(s32 posix_error) { + if (posix_error == 0) { + return 0; + } + return posix_error + ORBIS_KERNEL_ERROR_UNKNOWN; +} + void SetPosixErrno(s32 e) { // Some error numbers are different between supported OSes switch (e) { @@ -272,6 +279,7 @@ void RegisterLib(Core::Loader::SymbolsResolver* sym) { Libraries::Kernel::RegisterDebug(sym); LIB_OBJ("f7uOxY9mM1U", "libkernel", 1, "libkernel", 1, 1, &g_stack_chk_guard); + LIB_FUNCTION("D4yla3vx4tY", "libkernel", 1, "libkernel", 1, 1, sceKernelError); LIB_FUNCTION("Mv1zUObHvXI", "libkernel", 1, "libkernel", 1, 1, sceKernelGetSystemSwVersion); LIB_FUNCTION("PfccT7qURYE", "libkernel", 1, "libkernel", 1, 1, kernel_ioctl); LIB_FUNCTION("JGfTMBOdUJo", "libkernel", 1, "libkernel", 1, 1, sceKernelGetFsSandboxRandomWord);