diff options
| -rw-r--r-- | include/compat/sys/time.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/compat/sys/time.h b/include/compat/sys/time.h index 235bc6e..3d31985 100644 --- a/include/compat/sys/time.h +++ b/include/compat/sys/time.h | |||
| @@ -13,4 +13,20 @@ int gettimeofday(struct timeval *tp, void *tzp); | |||
| 13 | #include_next <sys/time.h> | 13 | #include_next <sys/time.h> |
| 14 | #endif | 14 | #endif |
| 15 | 15 | ||
| 16 | #ifndef CLOCK_MONOTONIC | ||
| 17 | #define CLOCK_MONOTONIC CLOCK_REALTIME | ||
| 18 | #endif | ||
| 19 | |||
| 20 | #ifndef timersub | ||
| 21 | #define timersub(tvp, uvp, vvp) \ | ||
| 22 | do { \ | ||
| 23 | (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ | ||
| 24 | (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ | ||
| 25 | if ((vvp)->tv_usec < 0) { \ | ||
| 26 | (vvp)->tv_sec--; \ | ||
| 27 | (vvp)->tv_usec += 1000000; \ | ||
| 28 | } \ | ||
| 29 | } while (0) | ||
| 30 | #endif | ||
| 31 | |||
| 16 | #endif | 32 | #endif |
