diff --git a/userspace/libraries/LibC/sys/resource.cpp b/userspace/libraries/LibC/sys/resource.cpp index e21c99a1..aca16eae 100644 --- a/userspace/libraries/LibC/sys/resource.cpp +++ b/userspace/libraries/LibC/sys/resource.cpp @@ -1,7 +1,20 @@ #include +#include #include -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; }