forked from Bananymous/banan-os
LibC: Implement dummy get_rusage
One port seems to use this function. This dummy just reports no used CPU time for current process nor children
This commit is contained in:
@@ -1,7 +1,20 @@
|
|||||||
#include <BAN/Assert.h>
|
#include <BAN/Assert.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
||||||
int getrusage(int, struct rusage*)
|
int getrusage(int who, struct rusage* r_usage)
|
||||||
{
|
{
|
||||||
ASSERT_NOT_REACHED();
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user