From 695935217bbd04043cbc326862905b9536549f40 Mon Sep 17 00:00:00 2001 From: Peter Bee Date: Wed, 20 Jan 2021 17:57:26 +0800 Subject: [PATCH] libc/sysconf: Add MONOTONIC_CLOCK for consistency MIRTOS-107 Add _SC_MONOTONIC_CLOCK to sysconf when CONFIG_CLOCK_MONOTONIC is set Change-Id: I0ae57798ebe89247a10ccb517e128866d1f907de Signed-off-by: Peter Bee --- libs/libc/unistd/lib_sysconf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libs/libc/unistd/lib_sysconf.c b/libs/libc/unistd/lib_sysconf.c index 84e37ab1b1..996c6f22c9 100644 --- a/libs/libc/unistd/lib_sysconf.c +++ b/libs/libc/unistd/lib_sysconf.c @@ -225,6 +225,13 @@ long sysconf(int name) return 1; #endif + case _SC_MONOTONIC_CLOCK: +#ifdef CONFIG_CLOCK_MONOTONIC + return 1; +#else + return 0; +#endif + case _SC_PAGESIZE: #ifdef CONFIG_MM_PGSIZE return CONFIG_MM_PGSIZE;