blob: 96dcf6d236b6b343ceddd8a2f119d66eac5691f4 [file] [log] [blame]
#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);
}