Fix time - sceKernelClockGettime (#2582)

This commit is contained in:
DanielSvoboda 2025-03-02 16:32:28 -03:00 committed by GitHub
parent 76483f9c7b
commit f4110c43a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -115,14 +115,16 @@ int PS4_SYSV_ABI sceKernelClockGettime(s32 clock_id, OrbisKernelTimespec* tp) {
break;
}
timespec t{};
int result = clock_gettime(pclock_id, &t);
tp->tv_sec = t.tv_sec;
tp->tv_nsec = t.tv_nsec;
if (result == 0) {
return ORBIS_OK;
time_t raw_time = time(nullptr);
if (raw_time == (time_t)(-1)) {
return ORBIS_KERNEL_ERROR_EINVAL;
}
return ORBIS_KERNEL_ERROR_EINVAL;
tp->tv_sec = static_cast<long>(raw_time);
tp->tv_nsec = 0;
return ORBIS_OK;
}
int PS4_SYSV_ABI posix_clock_gettime(s32 clock_id, OrbisKernelTimespec* time) {