2 ** Copyright 2004, Jérôme Duval, jerome.duval@free.fr.
3 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de.
4 ** Distributed under the terms of the MIT License.
10 #include <sys/resource.h>
11 #include <sys/times.h>
13 #include <symbol_versioning.h>
15 #include <errno_private.h>
16 #include <time_private.h>
17 #include <times_private.h>
21 times_common(struct tms
* buffer
, bigtime_t microSecondsPerClock
)
26 if ((err
= get_team_usage_info(B_CURRENT_TEAM
, RUSAGE_SELF
, &info
))
32 buffer
->tms_utime
= info
.user_time
/ microSecondsPerClock
;
33 buffer
->tms_stime
= info
.kernel_time
/ microSecondsPerClock
;
35 if ((err
= get_team_usage_info(B_CURRENT_TEAM
, RUSAGE_CHILDREN
, &info
))
41 buffer
->tms_cutime
= info
.user_time
/ microSecondsPerClock
;
42 buffer
->tms_cstime
= info
.kernel_time
/ microSecondsPerClock
;
44 return system_time() / microSecondsPerClock
;
49 __times_beos(struct tms
* buffer
)
51 return times_common(buffer
, MICROSECONDS_PER_CLOCK_TICK_BEOS
);
56 __times(struct tms
* buffer
)
58 return times_common(buffer
, MICROSECONDS_PER_CLOCK_TICK
);
62 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__times_beos", "times@", "BASE");
64 DEFINE_LIBROOT_KERNEL_SYMBOL_VERSION("__times", "times@@", "1_ALPHA4");