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

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

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