home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pthrd004.zip / emx / include / sys / time.h < prev   
C/C++ Source or Header  |  1998-10-17  |  2KB  |  69 lines

  1. /* sys/time.h (emx+gcc) */
  2.  
  3. #ifndef _SYS_TIME_H
  4. #define _SYS_TIME_H
  5.  
  6. #include <time.h>
  7.  
  8. #if defined (__cplusplus)
  9. extern "C" {
  10. #endif
  11.  
  12. #if !defined (_TIMEVAL)
  13. #define _TIMEVAL
  14. struct timeval
  15. {
  16.   long tv_sec;
  17.   long tv_usec;
  18. };
  19. #endif
  20.  
  21. /*
  22.  * Structure defined by POSIX.4 to be like a timeval.
  23.  */
  24. struct timespec {
  25.         time_t  tv_sec;         /* seconds */
  26.         long    tv_nsec;        /* and nanoseconds */
  27. };
  28.  
  29. #define TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
  30.         (ts)->tv_sec = (tv)->tv_sec;                                    \
  31.         (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
  32. }
  33. #define TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
  34.         (tv)->tv_sec = (ts)->tv_sec;                                    \
  35.         (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
  36. }
  37.  
  38.  
  39. #if !defined (_TIMEZONE)
  40. #define _TIMEZONE
  41. struct timezone
  42. {
  43.   int tz_minuteswest;           /* minutes west of Greenwich */
  44.   int tz_dsttime;               /* type of dst correction */
  45. };
  46. #define DST_NONE        0       /* not on dst */
  47. #define DST_USA         1       /* USA style dst */
  48. #define DST_AUST        2       /* Australian style dst */
  49. #define DST_WET         3       /* Western European dst */
  50. #define DST_MET         4       /* Middle European dst */
  51. #define DST_EET         5       /* Eastern European dst */
  52. #define DST_CAN         6       /* Canada */
  53. #endif
  54.  
  55. int utimes (__const__ char *, __const__ struct timeval *);
  56. int gettimeofday (struct timeval *, struct timezone *);
  57. int settimeofday (__const__ struct timeval *, __const__ struct timezone *);
  58.  
  59.  
  60. int _utimes (__const__ char *, __const__ struct timeval *);
  61. int _gettimeofday (struct timeval *, struct timezone *);
  62. int _settimeofday (__const__ struct timeval *, __const__ struct timezone *);
  63.  
  64. #if defined (__cplusplus)
  65. }
  66. #endif
  67.  
  68. #endif /* not _SYS_TIME_H */
  69.