summaryrefslogtreecommitdiff
path: root/src/libstddjb/timespec_from_tai.c
blob: 7bb84d464af383961f8dcb74f3d9e5f2001fb6f2 (plain)
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) ;
}