summaryrefslogtreecommitdiff
path: root/src/libstddjb/timespec_sysclock_from_tain.c
blob: 5544511df87492a88d47eee9e4fad629fb71b8f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* ISC license. */

#include <time.h>
#include <skalibs/tai.h>

int timespec_sysclock_from_tain (struct timespec *ts, tain_t const *t)
{
  if (!time_sysclock_from_tai(&ts->tv_sec, &t->sec)) return 0 ;
  ts->tv_nsec = t->nano ;
  return 1 ;
}