[libc] Add dummy _gettimeofday function when hardware do not have the RTC.

This commit is contained in:
ArdaFu 2017-05-05 17:50:51 +08:00
parent c65fc02427
commit 707540a8d3
1 changed files with 10 additions and 0 deletions

View File

@ -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