newlib-cygwin/libgloss/riscv/semihost-sys_ftime.c

17 lines
311 B
C
Raw Normal View History

2020-12-15 20:00:27 +08:00
/*
* Copyright (C) 2020 Embecosm Limited
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <machine/syscall.h>
#include <sys/timeb.h>
#include "semihost_syscall.h"
/* Get the current time. */
int
_ftime (struct timeb *tp)
{
tp->time = syscall_errno (SEMIHOST_time, 0);
tp->millitm = 0;
return 0;
}