From d29935b9cefa723d977a3be8b6b0a27d1449edf6 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 8 Nov 2016 10:33:21 +0800 Subject: [PATCH] newlib: fix `_times_r` syscall implementation tms_cstime should only take system time in child processes into account, so has to be zero. https://github.com/espressif/esp-idf/issues/81 --- components/newlib/time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/newlib/time.c b/components/newlib/time.c index 5f60e1d7b2..0d7b6b7474 100644 --- a/components/newlib/time.c +++ b/components/newlib/time.c @@ -112,7 +112,7 @@ void esp_setup_time_syscalls() clock_t IRAM_ATTR _times_r(struct _reent *r, struct tms *ptms) { clock_t t = xTaskGetTickCount() * (portTICK_PERIOD_MS * CLK_TCK / 1000); - ptms->tms_cstime = t; + ptms->tms_cstime = 0; ptms->tms_cutime = 0; ptms->tms_stime = t; ptms->tms_utime = 0;