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 15 /* Include stuff ************************************************************ */ 16 #include <time.h> 17 #include "php.h" 18 19 /* Struct stuff ************************************************************* */ 20 struct timezone { 21 int tz_minuteswest; 22 int tz_dsttime; 23 }; 24 25 26 struct itimerval { 27 struct timeval it_interval; /* next value */ 28 struct timeval it_value; /* current value */ 29 }; 30 31 #if !defined(timespec) && _MSC_VER < 1900 32 struct timespec 33 { 34 time_t tv_sec; /* seconds */ 35 long tv_nsec; /* nanoseconds */ 36 }; 37 #endif 38 39 #define ITIMER_REAL 0 /*generates sigalrm */ 40 #define ITIMER_VIRTUAL 1 /*generates sigvtalrm */ 41 #define ITIMER_VIRT 1 /*generates sigvtalrm */ 42 #define ITIMER_PROF 2 /*generates sigprof */ 43 44 typedef long suseconds_t; 45 46 /* Prototype stuff ********************************************************** */ 47 PHPAPI extern int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Info); 48 49 /* setitimer operates at 100 millisecond resolution */ 50 PHPAPI extern int setitimer(int which, const struct itimerval *value, 51 struct itimerval *ovalue); 52 53 PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp ); 54 55 PHPAPI int usleep(unsigned int useconds); 56 57 #endif 58