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

#include <sys/types.h>
#include <time.h>
#include <errno.h>
#include <skalibs/tai.h>

int tain_relative_from_timespec (tain_t *a, struct timespec const *ts)
{
  if (!tai_relative_from_timespec(tain_secp(a), ts)) return 0 ;
  a->nano = ts->tv_nsec ;
  return 1 ;
}