1: /*
   2:  * Copyright (c) 1986 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)time.h	1.3 (2.11BSD) 2000/4/21
   7:  */
   8: 
   9: #ifndef _SYS_TIME_H_
  10: #define _SYS_TIME_H_
  11: 
  12: #include <sys/types.h>
  13: 
  14: /*
  15:  * Structure returned by gettimeofday(2) system call,
  16:  * and used in other calls.
  17:  */
  18: struct timeval {
  19:     long    tv_sec;     /* seconds */
  20:     long    tv_usec;    /* and microseconds */
  21: };
  22: 
  23: /*
  24:  * Structure defined by POSIX.4 to be like a timeval but with nanoseconds
  25:  * instead of microseconds.  Silly on a PDP-11 but keeping the names the
  26:  * same makes life simpler than changing the names.
  27: */
  28: struct timespec {
  29:     time_t tv_sec;      /* seconds */
  30:     long   tv_nsec;     /* and nanoseconds */
  31: };
  32: 
  33: struct timezone {
  34:     int tz_minuteswest; /* minutes west of Greenwich */
  35:     int tz_dsttime; /* type of dst correction */
  36: };
  37: #define DST_NONE    0   /* not on dst */
  38: #define DST_USA     1   /* USA style dst */
  39: #define DST_AUST    2   /* Australian style dst */
  40: #define DST_WET     3   /* Western European dst */
  41: #define DST_MET     4   /* Middle European dst */
  42: #define DST_EET     5   /* Eastern European dst */
  43: #define DST_CAN     6   /* Canada */
  44: 
  45: /*
  46:  * Operations on timevals.
  47:  *
  48:  * NB: timercmp does not work for >= or <=.
  49:  */
  50: #define timerisset(tvp)     ((tvp)->tv_sec || (tvp)->tv_usec)
  51: #define timercmp(tvp, uvp, cmp) \
  52:     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  53:      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  54: #define timerclear(tvp)     (tvp)->tv_sec = (tvp)->tv_usec = 0
  55: 
  56: /*
  57:  * Names of the interval timers, and structure
  58:  * defining a timer setting.
  59:  */
  60: #define ITIMER_REAL 0
  61: #define ITIMER_VIRTUAL  1
  62: #define ITIMER_PROF 2
  63: 
  64: struct  k_itimerval {
  65:     long    it_interval;        /* timer interval */
  66:     long    it_value;       /* current value */
  67: };
  68: 
  69: struct  itimerval {
  70:     struct  timeval it_interval;    /* timer interval */
  71:     struct  timeval it_value;   /* current value */
  72: };
  73: 
  74: #ifndef KERNEL
  75: #include <time.h>
  76: #endif
  77: 
  78: /*
  79:  * Getkerninfo clock information structure
  80:  */
  81: struct clockinfo {
  82:     int hz;     /* clock frequency */
  83:     int tick;       /* micro-seconds per hz tick */
  84:     int stathz;     /* statistics clock frequency */
  85:     int profhz;     /* profiling clock frequency */
  86: };
  87: #endif	/* !_SYS_TIME_H_ */

Defined struct's

k_itimerval defined in line 64; used 6 times
timespec defined in line 28; used 6 times
timeval defined in line 18; used 470 times
timezone defined in line 33; used 182 times

Defined macros

DST_AUST defined in line 39; never used
DST_CAN defined in line 43; never used
DST_EET defined in line 42; never used
DST_MET defined in line 41; never used
DST_NONE defined in line 37; used 2 times
DST_USA defined in line 38; never used
DST_WET defined in line 40; never used
ITIMER_PROF defined in line 62; used 6 times
ITIMER_VIRTUAL defined in line 61; used 4 times
_SYS_TIME_H_ defined in line 10; used 1 times
  • in line 9
timercmp defined in line 51; used 2 times
timerisset defined in line 50; used 3 times

Usage of this include

time.h used 183 times
Last modified: 2000-04-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4284
Valid CSS Valid XHTML 1.0 Strict