skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

tain_from_timespec.c (221B)


      1 /* ISC license. */
      2 
      3 #include <time.h>
      4 #include <skalibs/tai.h>
      5 
      6 int tain_from_timespec (tain *t, struct timespec const *ts)
      7 {
      8   if (!tai_from_time(&t->sec, ts->tv_sec)) return 0 ;
      9   t->nano = ts->tv_nsec ;
     10   return 1 ;
     11 }