time.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*****************************************************************************
  2. * *
  3. * sys/time.h *
  4. * *
  5. * Freely redistributable and modifiable. Use at your own risk. *
  6. * *
  7. * Copyright 1994 The Downhill Project *
  8. *
  9. * Modified by Shane Caraveo for PHP
  10. *
  11. *****************************************************************************/
  12. #ifndef TIME_H
  13. #define TIME_H
  14. /* Include stuff ************************************************************ */
  15. #include <time.h>
  16. #include "php.h"
  17. /* Struct stuff ************************************************************* */
  18. struct timezone {
  19. int tz_minuteswest;
  20. int tz_dsttime;
  21. };
  22. struct itimerval {
  23. struct timeval it_interval; /* next value */
  24. struct timeval it_value; /* current value */
  25. };
  26. #ifndef timespec
  27. struct timespec
  28. {
  29. time_t tv_sec; /* seconds */
  30. long tv_nsec; /* nanoseconds */
  31. };
  32. #endif
  33. #define ITIMER_REAL 0 /*generates sigalrm */
  34. #define ITIMER_VIRTUAL 1 /*generates sigvtalrm */
  35. #define ITIMER_VIRT 1 /*generates sigvtalrm */
  36. #define ITIMER_PROF 2 /*generates sigprof */
  37. /* Prototype stuff ********************************************************** */
  38. PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info);
  39. /* setitimer operates at 100 millisecond resolution */
  40. PHPAPI extern int setitimer(int which, const struct itimerval *value,
  41. struct itimerval *ovalue);
  42. PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp );
  43. PHPAPI int usleep(unsigned int useconds);
  44. #endif