diff --git a/cpu/native/rtc/posix-rtc.c b/cpu/native/rtc/posix-rtc.c index 25f6cdf65f..f2d25c4995 100644 --- a/cpu/native/rtc/posix-rtc.c +++ b/cpu/native/rtc/posix-rtc.c @@ -24,6 +24,7 @@ #include "debug.h" #include "rtc.h" +#include "cpu.h" static int native_rtc_enabled; @@ -58,10 +59,12 @@ void rtc_get_localtime(struct tm *localt) time_t t; if (native_rtc_enabled == 1) { + _native_in_syscall++; t = time(NULL); if (localtime_r(&t, localt) == NULL) { err(1, "rtc_get_localtime: localtime_r"); } + _native_in_syscall--; } }