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