skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

sysclock_from_tai.c (389B)


      1 /* ISC license. */
      2 
      3 #include <errno.h>
      4 #include <skalibs/config.h>
      5 #include <skalibs/tai.h>
      6 
      7 #ifdef SKALIBS_FLAG_CLOCKISTAI
      8 
      9 int sysclock_from_tai (uint64_t *u, tai const *t)
     10 {
     11   if (t->x < 10U) return (errno = EINVAL, 0) ;
     12   *u = t->x - 10U ;
     13   return 1 ;
     14 }
     15 
     16 #else
     17 
     18 #include <skalibs/djbtime.h>
     19 
     20 int sysclock_from_tai (uint64_t *u, tai const *t)
     21 {
     22   return utc_from_tai(u, t) ;
     23 }
     24 
     25 #endif