5 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
8 Desc: ANSI-C header file sys/time.h
12 #include <aros/system.h>
13 #include <aros/types/timeval_s.h> /* get struct timeval */
15 /* struct itimerval is used by the interval timers getitimer()/setitimer() */
18 struct timeval it_interval
; /* timer interval */
19 struct timeval it_value
; /* current value */
22 /* Which interval timer */
23 #define ITIMER_REAL 0 /* Decrements in real time */
24 #define ITIMER_VIRTUAL 1 /* Decrements in task virtual time */
25 #define ITIMER_PROF 2 /* Decrements in task virtual/system time */
28 This structure describes a timezone. Note that most implementations of the
29 C library no longer use the timezone information passed to settimeofday().
33 int tz_minuteswest
; /* Minutes west of Greenwich. */
34 int tz_dsttime
; /* Type of dst correction (see below). */
37 /* Daylight saving time styles. (tz_dsttime) */
38 #define DST_NONE 0 /* No special style. */
39 #define DST_USA 1 /* USA style. */
40 #define DST_AUST 2 /* Australian style. */
41 #define DST_WET 3 /* Western European style. */
42 #define DST_MET 4 /* Middle European style. */
43 #define DST_EET 5 /* Eastern European style. */
44 #define DST_CAN 6 /* Canadian style. */
45 #define DST_GB 7 /* Great British and Irish style. */
46 #define DST_RUM 8 /* Rumanian style. */
47 #define DST_TUR 9 /* Turkish style. */
48 #define DST_AUSTALT 10 /* Alternate Australian style. */
50 /* Convenience macros for working with timevals */
51 #define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
52 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
53 #define timercmp(tvp, uvp, cmp) \
54 (((tvp)->tv_sec == (uvp)->tv_sec) ? \
55 ((tvp)->tv_usec cmp (uvp)->tv_usec) : \
56 ((tvp)->tv_sec cmp (uvp)->tv_sec))
57 #define timeradd(tvp, uvp, vvp) \
59 (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
60 (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
61 if ((vvp)->tv_usec >= 1000000) { \
63 (vvp)->tv_usec -= 1000000; \
66 #define timersub(tvp, uvp, vvp) \
68 (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
69 (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
70 if ((vvp)->tv_usec < 0) { \
72 (vvp)->tv_usec += 1000000; \
79 int getitimer(int which
, struct itimerval
*);
80 int setitimer(int which
, const struct itimerval
*, struct itimerval
*);
81 int gettimeofday(struct timeval
* tv
, struct timezone
* tz
);
82 int settimeofday(const struct timeval
* tv
, const struct timezone
* tz
);
83 int utimes(const char *file
, const struct timeval tvp
[2]);
88 SUSv2 says that select() is defined here. BSD however defines it in
89 unistd.h. So does AROS, as that makes more sense.
92 #endif /* _SYS_TIME_H_ */