diff options
Diffstat (limited to 'src/libstddjb/ltm64_from_sysclock.c')
-rw-r--r-- | src/libstddjb/ltm64_from_sysclock.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libstddjb/ltm64_from_sysclock.c b/src/libstddjb/ltm64_from_sysclock.c new file mode 100644 index 0000000..54aca39 --- /dev/null +++ b/src/libstddjb/ltm64_from_sysclock.c @@ -0,0 +1,24 @@ +/* ISC license. */ + +#include <skalibs/config.h> +#include <skalibs/uint64.h> +#include <skalibs/djbtime.h> + +#ifdef SKALIBS_FLAG_CLOCKISTAI + +#include <skalibs/tai.h> + +int ltm64_from_sysclock (uint64 *u) +{ + tai_t t = { *u + 10U } ; + return ltm64_from_tai(u, &t) ; +} + +#else + +int ltm64_from_sysclock (uint64 *u) +{ + return ltm64_from_utc(u) ; +} + +#endif |