From 4b15d9f46a2b260661d2e054575e617c76795578 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 25 Oct 2013 14:15:08 -0400 Subject: add legacy ftime function and sys/timeb.h despite being marked legacy, this was specified by SUSv3 as part of the XSI option; only the most recent version of the standard dropped it. reportedly there's actual code using it. --- src/time/ftime.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/time/ftime.c (limited to 'src') diff --git a/src/time/ftime.c b/src/time/ftime.c new file mode 100644 index 00000000..a1734d0f --- /dev/null +++ b/src/time/ftime.c @@ -0,0 +1,12 @@ +#include +#include + +int ftime(struct timeb *tp) +{ + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + tp->time = ts.tv_sec; + tp->millitm = ts.tv_nsec / 1000000; + tp->timezone = tp->dstflag = 0; + return 0; +} -- cgit v1.2.1