summaryrefslogtreecommitdiff
path: root/src/libstddjb/timeval_from_tai.c
blob: d0c4777b757a315768c761e37a649c86a3d38a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <sys/time.h>
#include <skalibs/tai.h>

int timeval_from_tai (struct timeval *tv, tai_t const *t)
{
  tai_t trel ;
  tai_u64(&trel, tai_sec(t) - TAI_MAGIC) ;
  return timeval_from_tai_relative(tv, &trel) ;
}