1 2 3 4 5 6 7 8 9 10 11 12
/* ISC license. */ #include <sys/types.h> #include <time.h> #include <skalibs/tai.h> int timespec_from_tai (struct timespec *ts, tai_t const *t) { tai_t trel ; tai_u64(&trel, tai_sec(t) - TAI_MAGIC) ; return timespec_from_tai_relative(ts, &trel) ; }