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