From a37ee5ff2c2ea189aa1aa345698178192079d9cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Franch?= Date: Tue, 13 Oct 2026 14:50:07 +0200 Subject: [PATCH] fix(libc): keep the caller errno when the Windows tm_year range overflows Co-Authored-By: Claude --- core/libs/prx/libc/src/Time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/libs/prx/libc/src/Time.cpp b/core/libs/prx/libc/src/Time.cpp index 7858ad2f1..056d0ab41 100644 --- a/core/libs/prx/libc/src/Time.cpp +++ b/core/libs/prx/libc/src/Time.cpp @@ -479,7 +479,7 @@ GuestTm* APS5_VABI localtime_s_nid_postfix(const int64_t* timer, GuestTm* result } const std::int64_t year = host.tm_year + cycles * CALENDAR_CYCLE_YEARS; if (year < std::numeric_limits::min() || year > std::numeric_limits::max()) { - errno = EINVAL; + errno = callerError; return nullptr; } host.tm_year = static_cast(year);