Add ftime function

This commit is contained in:
Francisco Javier Trujillo Mata
2021-11-23 01:31:24 +01:00
parent 98bed321f1
commit 04c4d9e76f
2 changed files with 19 additions and 2 deletions

View File

@@ -11,7 +11,6 @@ CPPFLAGS = -I$(top_srcdir)/src/base \
-I$(top_srcdir)/src/sdk \
-I$(top_srcdir)/src/kernel \
-I$(top_srcdir)/src/net \
-I$(top_srcdir)/src/user \
-I$(top_srcdir)/src/rtc \
-I$(top_srcdir)/src/user \
-I$(top_srcdir)/src/utility
@@ -27,7 +26,7 @@ FDMAN_OBJS = __descriptor_data_pool.o __descriptormap.o __fdman_init.o __fdman_g
GLUE_OBJS = __fill_stat.o __psp_heap_blockid.o __psp_free_heap.o _fork.o _wait.o _open.o _close.o _read.o _write.o _fstat.o \
_stat.o lstat.o access.o _fcntl.o _lseek.o chdir.o mkdir.o rmdir.o getdents.o _seekdir.o _link.o _unlink.o \
_rename.o _getpid.o _kill.o _sbrk.o _gettimeofday.o _times.o _internal_malloc_lock.o _internal_malloc_unlock.o \
_rename.o _getpid.o _kill.o _sbrk.o _gettimeofday.o _times.o ftime.o _internal_malloc_lock.o _internal_malloc_unlock.o \
_isatty.o symlink.o truncate.o chmod.o fchmod.o fchmodat.o pathconf.o readlink.o utime.o fchown.o getentropy.o

View File

@@ -24,6 +24,7 @@
#include <unistd.h>
#include <sys/time.h>
#include <sys/timeb.h>
#include <sys/times.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -734,6 +735,23 @@ clock_t _times(struct tms *buffer)
}
#endif
#ifdef F_ftime
int ftime(struct timeb *tb)
{
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
tb->time = tv.tv_sec;
tb->millitm = tv.tv_usec / 1000;
tb->timezone = tz.tz_minuteswest;
tb->dstflag = tz.tz_dsttime;
return 0;
}
#endif
#ifdef F__internal_malloc_lock
void _internal_malloc_lock(struct _reent *ptr)
{