summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_from_timespec.c
blob: e862f46a514aa577d5048a53b4b71b5c0557bdca (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_from_timespec (tain_t *a, struct timespec const *ts)
{
  if (!tai_from_timespec(tain_secp(a), ts)) return 0 ;
  a->nano = ts->tv_nsec ;
  return 1 ;
}