2 ** Copyright 2004, Jérôme Duval, jerome.duval@free.fr.
3 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
4 ** Distributed under the terms of the MIT License.
8 #include <sys/resource.h>
11 #include <errno_private.h>
15 getrusage(int who
, struct rusage
*rusage
)
19 if (get_team_usage_info(B_CURRENT_TEAM
, who
, &info
) != B_OK
) {
20 __set_errno(B_BAD_VALUE
);
24 rusage
->ru_utime
.tv_sec
= info
.user_time
/ 1000000;
25 rusage
->ru_utime
.tv_usec
= info
.user_time
% 1000000;
27 rusage
->ru_stime
.tv_sec
= info
.kernel_time
/ 1000000;
28 rusage
->ru_stime
.tv_usec
= info
.kernel_time
% 1000000;