ref: e0b01eb11d97d9d1e1f36cd9a62c87b9bd33c50c
dir: /src/dos/sys.c/
#include "sl.h"
#include "timefuncs.h"
double
sec_realtime(void)
{
return 0.0;
}
u64int
nanosec_monotonic(void)
{
return 0;
}
void
timestring(double s, char *buf, int sz)
{
time_t tme = (time_t)s;
struct tm tm;
*buf = 0;
if(localtime_r(&tme, &tm) != nil)
strftime(buf, sz, "%a %b %e %H:%M:%S %Y", &tm);
}
double
parsetime(const char *s)
{
return -1;
}
void
sleep_ms(int ms)
{
if(ms != 0){
struct timeval timeout;
timeout.tv_sec = ms/1000;
timeout.tv_usec = (ms % 1000) * 1000;
select(0, nil, nil, nil, &timeout);
}
}
static const u8int boot[] = {
#include "sl.boot.h"
};
int
main(int argc, char **argv)
{
setlocale(LC_NUMERIC, "C");
setlocale(LC_CTYPE, "");
slmain(boot, sizeof(boot), argc, argv);
}