summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c
index 44c9e2b2f1..867ca2dc60 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1572,8 +1572,13 @@ void thread_set_yield_time(struct thread *thread, unsigned long yield_time)
void thread_getrusage(RUSAGE_T *r)
{
+#if defined RUSAGE_THREAD
+#define FRR_RUSAGE RUSAGE_THREAD
+#else
+#define FRR_RUSAGE RUSAGE_SELF
+#endif
monotime(&r->real);
- getrusage(RUSAGE_SELF, &(r->cpu));
+ getrusage(FRR_RUSAGE, &(r->cpu));
}
/*