ARM SYS_time => SYS_gettimeofday

This commit is contained in:
Jan (janneke) Nieuwenhuizen 2022-05-01 13:21:23 +02:00 committed by Jan Nieuwenhuizen
parent a4fa47a108
commit 2eccd4c5c6
1 changed files with 11 additions and 3 deletions

View File

@ -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;
}