summaryrefslogtreecommitdiff
path: root/lib/getrusage.c
blob: 96dcf6d236b6b343ceddd8a2f119d66eac5691f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <errno.h>
#include "getrusage.h"

int fio_getrusage(struct rusage *ru)
{
#ifdef CONFIG_RUSAGE_THREAD
	if (!getrusage(RUSAGE_THREAD, ru))
		return 0;
	if (errno != EINVAL)
		return -1;
	/* Fall through to RUSAGE_SELF */
#endif
	return getrusage(RUSAGE_SELF, ru);
}