mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
Fix time - sceKernelClockGettime (#2582)
This commit is contained in:
parent
76483f9c7b
commit
f4110c43a7
1 changed files with 9 additions and 7 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue