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

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

int tain_from_timeval (tain_t *a, struct timeval const *tv)
{
  if (!tai_from_timeval(tain_secp(a), tv)) return 0 ;
  a->nano = 1000 * tv->tv_usec ;
  return 1 ;
}