mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibC: Add settimeofday
This commit is contained in:
parent
0736ae4116
commit
0fff4e11a6
2 changed files with 8 additions and 0 deletions
|
@ -55,6 +55,13 @@ int gettimeofday(struct timeval* __restrict__ tv, void* __restrict__)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int settimeofday(struct timeval* __restrict__ tv, void* __restrict__)
|
||||
{
|
||||
timespec ts;
|
||||
TIMEVAL_TO_TIMESPEC(tv, &ts);
|
||||
return clock_settime(CLOCK_REALTIME, &ts);
|
||||
}
|
||||
|
||||
char* ctime(const time_t* t)
|
||||
{
|
||||
return asctime(localtime(t));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue