ARM SYS_time => SYS_gettimeofday
This commit is contained in:
parent
a4fa47a108
commit
2eccd4c5c6
|
@ -1,6 +1,6 @@
|
|||
/* -*-comment-start: "//";comment-end:""-*-
|
||||
* GNU Mes --- Maxwell Equations of Software
|
||||
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||
*
|
||||
* This file is part of GNU Mes.
|
||||
*
|
||||
|
@ -23,7 +23,15 @@
|
|||
#include <time.h>
|
||||
|
||||
long
|
||||
time (long *result)
|
||||
time (long* result)
|
||||
{
|
||||
return _sys_call1 (SYS_time, result);
|
||||
int r;
|
||||
struct timeval tv;
|
||||
struct timezone tz;
|
||||
r = _sys_call2 (SYS_gettimeofday, tv, tz);
|
||||
if (r != 0)
|
||||
return -1;
|
||||
if (result != 0)
|
||||
result[0] = tv->tv_sec;
|
||||
return tv->tv_sec;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue