1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

add rtc_time implementation for native

This commit is contained in:
Christian Mehlis 2013-10-19 20:17:44 +02:00
parent 634a784cd2
commit 945aefad4f

View File

@ -68,3 +68,17 @@ void rtc_get_localtime(struct tm *localt)
_native_in_syscall--;
}
}
time_t rtc_time(struct timeval *time)
{
if (native_rtc_enabled == 1) {
_native_in_syscall++;
if (gettimeofday(time, 0) == 0) {
errx(1, "rtc_time: gettimeofday: error");
}
_native_in_syscall--;
}
return time->tv_sec;
}