2024-08-22 14:28:39 +03:00
|
|
|
#include <BAN/Assert.h>
|
2024-09-17 15:59:22 +03:00
|
|
|
#include <errno.h>
|
2024-08-22 14:28:39 +03:00
|
|
|
#include <sys/resource.h>
|
|
|
|
|
2024-09-17 15:59:22 +03:00
|
|
|
int getrusage(int who, struct rusage* r_usage)
|
2024-08-22 14:28:39 +03:00
|
|
|
{
|
2024-09-17 15:59:22 +03:00
|
|
|
if (who != RUSAGE_CHILDREN && who != RUSAGE_SELF)
|
|
|
|
{
|
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
r_usage->ru_stime.tv_sec = 0;
|
|
|
|
r_usage->ru_stime.tv_usec = 0;
|
|
|
|
|
|
|
|
r_usage->ru_utime.tv_sec = 0;
|
|
|
|
r_usage->ru_utime.tv_usec = 0;
|
|
|
|
|
|
|
|
return 0;
|
2024-08-22 14:28:39 +03:00
|
|
|
}
|