summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-05-05 18:01:50 +0800
committerGitHub <[email protected]>2017-05-05 18:01:50 +0800
commit5b73dfa0d573f4e6f9b71feaa6528af0dfdaf10e (patch)
treef31f25fb5b7a8b71975a275b0d1efc15e3371e1b
parentc65fc024279d7475fa79441d8f06b74f1d6a7460 (diff)
parent707540a8d3803f229efa431eb8915ddfc1d284e8 (diff)
Merge pull request #731 from ArdaFu/master
[libc] Add dummy _gettimeofday function when hardware do not have the…
-rw-r--r--components/libc/minilibc/time.c10
1 files changed, 10 insertions, 0 deletions
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