mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-09 20:49:23 +01:00
29 lines
533 B
C
29 lines
533 B
C
#include "wut_newlib.h"
|
|
#include "wut_clock.h"
|
|
|
|
#include <coreinit/time.h>
|
|
|
|
int
|
|
__wut_gettod_r(struct _reent *ptr,
|
|
struct timeval *tp,
|
|
struct timezone *tz)
|
|
{
|
|
OSTime time = OSGetTime();
|
|
|
|
if (tp != NULL) {
|
|
tp->tv_sec = (time_t)OSTicksToSeconds(time);
|
|
|
|
time -= OSSecondsToTicks(tp->tv_sec);
|
|
tp->tv_usec = (long)OSTicksToMicroseconds(time);
|
|
|
|
tp->tv_sec += EPOCH_DIFF_SECS;
|
|
}
|
|
|
|
if (tz != NULL) {
|
|
tz->tz_minuteswest = 0;
|
|
tz->tz_dsttime = 0;
|
|
}
|
|
|
|
return 0;
|
|
}
|