utc_from_sysclock.c (346B)
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 #include <skalibs/tai.h> 10 11 int utc_from_sysclock (uint64_t *u) 12 { 13 tai t = { .x = *u + 10U } ; 14 return utc_from_tai(u, &t) ; 15 } 16 17 #else 18 19 int utc_from_sysclock (uint64_t *u) 20 { 21 (void)u ; 22 return 1 ; 23 } 24 25 #endif