Fork me on GitHub

root/include/fiwix/time.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * fiwix/include/fiwix/time.h
   3  *
   4  * Copyright 2018, Jordi Sanfeliu. All rights reserved.
   5  * Distributed under the terms of the Fiwix License.
   6  */
   7 
   8 #ifndef _FIWIX_TIME_H
   9 #define _FIWIX_TIME_H
  10 
  11 #define ITIMER_REAL     0
  12 #define ITIMER_VIRTUAL  1
  13 #define ITIMER_PROF     2
  14 
  15 struct timespec {
  16         long int tv_sec;        /* seconds since 00:00:00, 1 Jan 1970 UTC */
  17         long int tv_nsec;       /* nanoseconds (1000000000ns = 1sec) */
  18 };
  19 
  20 struct timeval {
  21         long int tv_sec;        /* seconds since 00:00:00, 1 Jan 1970 UTC */
  22         long int tv_usec;       /* microseconds (1000000us = 1sec) */
  23 };
  24 
  25 struct timezone {
  26         int tz_minuteswest;     /* minutes west of GMT */
  27         int tz_dsttime;         /* type of DST correction */
  28 };
  29 
  30 struct itimerval {
  31         struct timeval it_interval;
  32         struct timeval it_value;
  33 };
  34 
  35 struct mt {
  36         int mt_sec;
  37         int mt_min;
  38         int mt_hour;
  39         int mt_day;
  40         int mt_month;
  41         int mt_year;
  42 };
  43 
  44 unsigned long int tv2ticks(const struct timeval *);
  45 void ticks2tv(long int, struct timeval *);
  46 int setitimer(int, const struct itimerval *, struct itimerval *);
  47 unsigned long int mktime(struct mt *);
  48 
  49 #endif /* _FIWIX_TIME_H */

/* [previous][next][first][last][top][bottom][index][help] */