From 707540a8d3803f229efa431eb8915ddfc1d284e8 Mon Sep 17 00:00:00 2001 From: ArdaFu Date: Fri, 5 May 2017 17:50:51 +0800 Subject: [PATCH] [libc] Add dummy _gettimeofday function when hardware do not have the RTC. --- components/libc/minilibc/time.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/libc/minilibc/time.c b/components/libc/minilibc/time.c index 8faa3e0470..efd6be8754 100644 --- a/components/libc/minilibc/time.c +++ b/components/libc/minilibc/time.c @@ -217,3 +217,13 @@ int gettimeofday(struct timeval *tp, void *ignore) return 0; } #endif + +#ifndef _gettimeofday +/* Dummy function when hardware do not have RTC */ +int _gettimeofday( struct timeval *tv, void *ignore) +{ + tv->tv_sec = 0; // convert to seconds + tv->tv_usec = 0; // get remaining microseconds + return 0; // return non-zero for error +} +#endif