home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / sys / h / time < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.0 KB  |  80 lines

  1. /*
  2.  * $Header: /ax/networking:include/sys/time.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/time.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    time.h,v $
  8.  * Revision 1.1  95/01/11  10:19:59  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.4  88/10/11  10:26:26  keith
  12.  * Protect <sys/time.h> against multiple inclusion.
  13.  * 
  14.  * Revision 1.3  88/06/17  20:21:51  beta
  15.  * Acorn Unix initial beta version
  16.  * 
  17.  */
  18. /* @(#)time.h    1.2 87/05/15 3.2/4.3NFSSRC */
  19. /*
  20.  * Copyright (c) 1982, 1986 Regents of the University of California.
  21.  * All rights reserved.  The Berkeley software License Agreement
  22.  * specifies the terms and conditions for redistribution.
  23.  *
  24.  *    @(#)time.h    7.1 (Berkeley) 6/4/86
  25.  */
  26.  
  27. #ifndef __SYS_TIME__
  28. #define __SYS_TIME__
  29. /*
  30.  * Structure returned by gettimeofday(2) system call,
  31.  * and used in other calls.
  32.  */
  33. struct timeval {
  34.     long    tv_sec;        /* seconds */
  35.     long    tv_usec;    /* and microseconds */
  36. };
  37.  
  38. struct timezone {
  39.     int    tz_minuteswest;    /* minutes west of Greenwich */
  40.     int    tz_dsttime;    /* type of dst correction */
  41. };
  42. #define    DST_NONE    0    /* not on dst */
  43. #define    DST_USA        1    /* USA style dst */
  44. #define    DST_AUST    2    /* Australian style dst */
  45. #define    DST_WET        3    /* Western European dst */
  46. #define    DST_MET        4    /* Middle European dst */
  47. #define    DST_EET        5    /* Eastern European dst */
  48. #define    DST_CAN        6    /* Canada */
  49.  
  50. /*
  51.  * Operations on timevals.
  52.  *
  53.  * NB: timercmp does not work for >= or <=.
  54.  */
  55. #define    timerisset(tvp)        ((tvp)->tv_sec || (tvp)->tv_usec)
  56. #define    timercmp(tvp, uvp, cmp)    \
  57.     ((tvp)->tv_sec cmp (uvp)->tv_sec || \
  58.      (tvp)->tv_sec == (uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
  59. #define    timerclear(tvp)        (tvp)->tv_sec = (tvp)->tv_usec = 0
  60.  
  61. /*
  62.  * Names of the interval timers, and structure
  63.  * defining a timer setting.
  64.  */
  65. #define    ITIMER_REAL    0
  66. #define    ITIMER_VIRTUAL    1
  67. #define    ITIMER_PROF    2
  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. #endif /* !__SYS_TIME__ */
  78.  
  79. /* EOF time.h */
  80.