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

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

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