summaryrefslogtreecommitdiff
path: root/src/libstddjb/sysclock_from_tai.c
blob: 003e962834d74bace904251cf9ae979f2c950229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* ISC license. */

#include <errno.h>
#include <skalibs/config.h>
#include <skalibs/tai.h>

#ifdef SKALIBS_FLAG_CLOCKISTAI

int sysclock_from_tai (uint64_t *u, tai_t const *t)
{
  if (t->x < 10U) return (errno = EINVAL, 0) ;
  *u = t->x - 10U ;
  return 1 ;
}

#else

#include <skalibs/djbtime.h>

int sysclock_from_tai (uint64_t *u, tai_t const *t)
{
  return utc_from_tai(u, t) ;
}

#endif