skalibs

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

sysclock_from_ltm64.c (354B)


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