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