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

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

int tain_from_timeval_sysclock (tain_t *t, struct timeval const *tv)
{
  if (!tai_from_time_sysclock(&t->sec, tv->tv_sec)) return 0 ;
  t->nano = 1000 * tv->tv_usec ;
  return 1 ;
}