]> granicus.if.org Git - esp-idf/commitdiff
newlib: fix `_times_r` syscall implementation
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 8 Nov 2016 02:33:21 +0000 (10:33 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 8 Nov 2016 12:17:08 +0000 (20:17 +0800)
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

index 5f60e1d7b2bd585f16fd5a15330f1eb15ba1bb8d..0d7b6b74749bf3ac6323dfbd0d9a7b7a73f3a56f 100644 (file)
@@ -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;