Replace FIO_HAVE_RUSAGE_THREAD with RUSAGE_THREAD
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index 266595262e6fc2ce3595bdeabb12111480036e70..522901a993e89f70d6f075ac9e5c2ebd52e77eae 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -16,7 +16,11 @@ void update_rusage_stat(struct thread_data *td)
 {
        struct thread_stat *ts = &td->ts;
 
+#ifdef RUSAGE_THREAD
+       getrusage(RUSAGE_THREAD, &td->ru_end);
+#else
        getrusage(RUSAGE_SELF, &td->ru_end);
+#endif
 
        ts->usr_time += mtime_since(&td->ru_start.ru_utime,
                                        &td->ru_end.ru_utime);
@@ -534,7 +538,7 @@ void show_thread_status(struct thread_stat *ts, struct group_run_stats *rs)
                return;
 
        time(&time_p);
-       ctime_r((const time_t *) &time_p, time_buf);
+       os_ctime_r((const time_t *) &time_p, time_buf, sizeof(time_buf));
 
        if (!ts->error) {
                log_info("%s: (groupid=%d, jobs=%d): err=%2d: pid=%d: %s",