1 #ifndef _SYS_TIME_H 2 #define _SYS_TIME_H 3 /* 4 ** Distributed under the terms of the OpenBeOS License. 5 */ 6 7 8 #include <sys/types.h> 9 10 11 struct timeval { 12 time_t tv_sec; /* seconds */ 13 suseconds_t tv_usec; /* microseconds */ 14 }; 15 16 #include <sys/select.h> 17 /* circular dependency: fd_set needs to be defined and the 18 * select prototype exported by this file, but <sys/select.h> 19 * needs struct timeval. 20 */ 21 22 struct timezone { 23 int tz_minuteswest; 24 int tz_dsttime; 25 }; 26 27 struct itimerval { 28 struct timeval it_interval; 29 struct timeval it_value; 30 }; 31 32 #define ITIMER_REAL 1 /* real time */ 33 #define ITIMER_VIRTUAL 2 /* process virtual time */ 34 #define ITIMER_PROF 3 /* both */ 35 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 extern int getitimer(int which, struct itimerval *value); 42 extern int setitimer(int which, const struct itimerval *value, struct itimerval *oldValue); 43 extern int gettimeofday(struct timeval *tv, struct timezone *tz); 44 45 extern int utimes(const char *name, const struct timeval times[2]); 46 /* legacy */ 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* _SYS_TIME_H */ 53