libc: Add struct tm and localtime(), gmtime() stubs

This commit is contained in:
apio 2022-10-22 12:17:48 +02:00
parent 91969d4d48
commit 81c337cf9a
2 changed files with 30 additions and 0 deletions

View File

@ -4,6 +4,22 @@
typedef long int clock_t;
typedef long int time_t;
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long tm_gmtoff;
const char* tm_zone;
};
#define CLOCKS_PER_SEC 1000
#ifdef __cplusplus
@ -18,6 +34,9 @@ extern "C"
/* FIXME: For now, is an alias for clock(), but in seconds. */
time_t time(time_t* tloc);
struct tm* localtime(const time_t* timep); // Not implemented.
struct tm* gmtime(const time_t* timep); // Not implemented.
#ifdef __cplusplus
}
#endif

View File

@ -1,3 +1,4 @@
#include <luna.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
@ -17,4 +18,14 @@ extern "C"
if (tloc) { *tloc = result; }
return result;
}
struct tm* localtime(const time_t*)
{
NOT_IMPLEMENTED("localtime");
}
struct tm* gmtime(const time_t*)
{
NOT_IMPLEMENTED("gmtime");
}
}