2022-10-22 10:17:48 +00:00
|
|
|
#include <luna.h>
|
2022-10-15 11:21:22 +00:00
|
|
|
#include <sys/syscall.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
clock_t clock()
|
|
|
|
{
|
|
|
|
return syscall(SYS_clock);
|
|
|
|
}
|
2022-10-21 16:32:01 +00:00
|
|
|
|
|
|
|
time_t time(
|
|
|
|
time_t* tloc) // Very big FIXME: This is not the time of day, this just returns the same as clock() but in
|
|
|
|
// seconds. This is definitely wrong, but I'm not implementing a whole time system right now.
|
|
|
|
{
|
|
|
|
time_t result = (time_t)(syscall(SYS_clock) / CLOCKS_PER_SEC);
|
|
|
|
if (tloc) { *tloc = result; }
|
|
|
|
return result;
|
|
|
|
}
|
2022-10-22 10:17:48 +00:00
|
|
|
|
|
|
|
struct tm* localtime(const time_t*)
|
|
|
|
{
|
|
|
|
NOT_IMPLEMENTED("localtime");
|
|
|
|
}
|
|
|
|
|
|
|
|
struct tm* gmtime(const time_t*)
|
|
|
|
{
|
|
|
|
NOT_IMPLEMENTED("gmtime");
|
|
|
|
}
|
2022-10-23 08:01:03 +00:00
|
|
|
|
|
|
|
size_t strftime(char*, size_t, const char*, const struct tm*)
|
|
|
|
{
|
|
|
|
NOT_IMPLEMENTED("strftime");
|
|
|
|
}
|
2022-10-15 11:21:22 +00:00
|
|
|
}
|