Mercurial > dropbear
changeset 1468:b528e3753af4
define CLOCK_MONOTONIC if needed
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 08 Feb 2018 22:07:59 +0800 |
parents | 7279a633cc50 |
children | 51043e868f55 |
files | dbutil.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/dbutil.c Fri Jan 26 00:32:39 2018 +0800 +++ b/dbutil.c Thu Feb 08 22:07:59 2018 +0800 @@ -634,6 +634,10 @@ #ifndef CLOCK_MONOTONIC_COARSE #define CLOCK_MONOTONIC_COARSE 6 #endif +/* Some old toolchains know SYS_clock_gettime but not CLOCK_MONOTONIC */ +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 1 +#endif static clockid_t get_linux_clock_source() { struct timespec ts; if (syscall(SYS_clock_gettime, CLOCK_MONOTONIC_COARSE, &ts) == 0) {