fix load_ioengine() not to support no "external:" prefix
[fio.git] / lib / getrusage.c
CommitLineData
44404c5a
JA
1#include <errno.h>
2#include "getrusage.h"
3
4int fio_getrusage(struct rusage *ru)
5{
6#ifdef CONFIG_RUSAGE_THREAD
7 if (!getrusage(RUSAGE_THREAD, ru))
8 return 0;
9 if (errno != EINVAL)
10 return -1;
11 /* Fall through to RUSAGE_SELF */
12#endif
13 return getrusage(RUSAGE_SELF, ru);
14}