From 4ae57a7fb13e68c5e6f1c1246a867555dbd986db Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 29 Aug 2022 13:57:47 +0200 Subject: user/lua: implement the bare minimum for it to link and "run" --- src/user/lib/time.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/user/lib/time.c (limited to 'src/user/lib/time.c') diff --git a/src/user/lib/time.c b/src/user/lib/time.c new file mode 100644 index 0000000..4709ecd --- /dev/null +++ b/src/user/lib/time.c @@ -0,0 +1,43 @@ +#include +#include + +// TODO time +time_t time(time_t *tloc) { + time_t ret = 0; + if (tloc) *tloc = ret; + return ret; +} + +clock_t clock(void) { + return 0; +} + +struct tm *gmtime(const time_t *timer) { + (void)timer; + errno = ENOSYS; + return NULL; +} + +struct tm *localtime(const time_t *timer) { + (void)timer; + errno = ENOSYS; + return NULL; +} + +time_t mktime(struct tm *timeptr) { + (void)timeptr; + return 0; +} + +double difftime(time_t time1, time_t time0) { + (void)time1; (void)time0; + return 0; +} + +size_t strftime( + char *restrict s, size_t maxsize, + const char *restrict format, const struct tm *restrict timeptr) +{ + (void)s; (void)maxsize; (void)format; (void)timeptr; + return 0; +} -- cgit v1.2.3