summaryrefslogtreecommitdiff
path: root/src/libstddjb/tain_from_timeval.c
blob: 05360704cddc68125b819e4cf2111cbe523713b2 (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 (tain_t *t, struct timeval const *tv)
{
  if (!tai_from_time(&t->sec, tv->tv_sec)) return 0 ;
  t->nano = 1000 * tv->tv_usec ;
  return 1 ;
}