mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
[orbiskernel] +sys_gettimeofday
This commit is contained in:
parent
2e8afc27bc
commit
24d8a8ae8e
2 changed files with 35 additions and 7 deletions
|
|
@ -112,12 +112,30 @@ orbis::SysResult orbis::sys_nanosleep(Thread *thread, ptr<const timespec> rqtp,
|
|||
ptr<timespec> rmtp) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_gettimeofday(Thread *thread, ptr<struct timeval> tp,
|
||||
ptr<struct timezone> tzp) {
|
||||
return ErrorCode::NOSYS;
|
||||
orbis::SysResult orbis::sys_gettimeofday(Thread *thread, ptr<orbis::timeval> tp,
|
||||
ptr<orbis::timezone> tzp) {
|
||||
struct ::timeval tv;
|
||||
struct ::timezone tz;
|
||||
if (::gettimeofday(&tv, &tz) != 0)
|
||||
std::abort();
|
||||
if (tp) {
|
||||
orbis::timeval value;
|
||||
value.tv_sec = tv.tv_sec;
|
||||
value.tv_usec = tv.tv_usec;
|
||||
if (auto e = uwrite(tp, value); e != ErrorCode{})
|
||||
return e;
|
||||
}
|
||||
if (tzp) {
|
||||
orbis::timezone value;
|
||||
value.tz_dsttime = tz.tz_dsttime;
|
||||
value.tz_minuteswest = tz.tz_minuteswest;
|
||||
if (auto e = uwrite(tzp, value); e != ErrorCode{})
|
||||
return e;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
orbis::SysResult orbis::sys_settimeofday(Thread *thread, ptr<struct timeval> tp,
|
||||
ptr<struct timezone> tzp) {
|
||||
ptr<orbis::timezone> tzp) {
|
||||
return ErrorCode::NOSYS;
|
||||
}
|
||||
orbis::SysResult orbis::sys_getitimer(Thread *thread, uint which,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue