timeval_from_tain.c (239B)
1 /* ISC license. */ 2 3 #include <sys/time.h> 4 #include <skalibs/tai.h> 5 6 int timeval_from_tain (struct timeval *tv, tain const *t) 7 { 8 if (!time_from_tai(&tv->tv_sec, &t->sec)) return 0 ; 9 tv->tv_usec = (t->nano + 500) / 1000 ; 10 return 1 ; 11 }