libc: Add bad time() function
It's just an alias for clock(). Which is not good. But it's a stub, that's the point.
This commit is contained in:
parent
c8a37eaf70
commit
bf026d0dea
@ -15,6 +15,9 @@ extern "C"
|
||||
* get the value in seconds. */
|
||||
clock_t clock(void);
|
||||
|
||||
/* FIXME: For now, is an alias for clock(), but in seconds. */
|
||||
time_t time(time_t* tloc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -8,4 +8,13 @@ extern "C"
|
||||
{
|
||||
return syscall(SYS_clock);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user