7 /* All symbols from select.h except pselect are required anyway... */
8 #include <sys/select.h>
11 #define __NEED_suseconds_t
12 #define __NEED_struct_timeval
14 #include <bits/alltypes.h>
18 int gettimeofday (struct timeval *, void *);
20 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
23 #define ITIMER_VIRTUAL 1
28 struct timeval it_interval;
29 struct timeval it_value;
32 int getitimer (int, struct itimerval *);
33 int setitimer (int, const struct itimerval *, struct itimerval *);
34 int utimes (const char *, const struct timeval [2]);
39 int settimeofday (const struct timeval *, void *);
40 int adjtime (const struct timeval *, struct timeval *);
45 #define timerisset(t) ((t)->tv_sec || (t)->tv_usec)
46 #define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0)
47 #define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \
48 (s)->tv_usec op (t)->tv_usec : (s)->tv_sec op (t)->tv_sec)
49 #define timeradd(s,t,a) ( (a)->tv_sec = (s)->tv_sec + (t)->tv_sec, \
50 ((a)->tv_usec = (s)->tv_usec + (t)->tv_usec) >= 1000000 && \
51 ((a)->tv_usec -= 1000000, (a)->tv_sec++) )
52 #define timersub(s,t,a) ( (a)->tv_sec = (s)->tv_sec - (t)->tv_sec, \
53 ((a)->tv_usec = (s)->tv_usec - (t)->tv_usec) < 0 && \
54 ((a)->tv_usec += 1000000, (a)->tv_sec--) )