Implement no-op time() function

This commit is contained in:
avdgrinten 2015-12-13 22:17:25 +01:00
parent deb2ac7341
commit 8da5329a95
3 changed files with 19 additions and 5 deletions

View file

@ -15,10 +15,7 @@ time_t mktime(struct tm *ptr){
__ensure(!"Not implemented");
__builtin_unreachable();
}
time_t time(time_t *timer){
__ensure(!"Not implemented");
__builtin_unreachable();
}
// time() is provided by the platform
int timespec_get(struct timespec *ptr, int base){
__ensure(!"Not implemented");
__builtin_unreachable();

View file

@ -6,7 +6,7 @@ $c_OBJDIR := $(BUILD_PATH)/$c/obj
$c_BINDIR := $(BUILD_PATH)/$c/bin
$c_OBJECTS := entry.o ensure.o malloc.o file.o \
fork-exec.o enter-fork.o \
fork-exec.o enter-fork.o time.o \
frigg-support.o
$c_OBJECT_PATHS := $(addprefix $($c_OBJDIR)/,$($c_OBJECTS))

View file

@ -0,0 +1,17 @@
#include <time.h>
#pragma GCC visibility push(hidden)
#include <frigg/debug.hpp>
#pragma GCC visibility pop
time_t time(time_t *out){
frigg::infoLogger.log() << "mlibc: Broken time() called!" << frigg::EndLog();
time_t result = 0;
if(out)
*out = result;
return result;
}