blob: 0b467217efee7b6e1b60dfa45486c7f917b6cc6c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
/* ISC license. */
#include <errno.h>
#include <skalibs/djbtime.h>
#include "djbtime-internal.h"
int utc_from_tai (uint64_t *u, tai_t const *t)
{
uint64_t tt = t->x - 10 ;
if (t->x < 10U) return (errno = EINVAL, 0) ;
leapsecs_sub(&tt) ;
*u = tt ;
return 1 ;
}
|