Browse Source

`times` should always return 0 for `tms_cutime` (#510)

`tms_cutime` is the sum of the user times of child processes *excluding
the current process*. Since WASI doesn't provide a way to spawn a new
process, this value should always be 0.
pull/511/head
Yuta Saito 4 months ago
committed by GitHub
parent
commit
67080fa045
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      libc-bottom-half/clocks/times.c

3
libc-bottom-half/clocks/times.c

@ -17,7 +17,8 @@ clock_t times(struct tms *buffer) {
__wasi_timestamp_t user = __clock();
*buffer = (struct tms){
.tms_utime = user,
.tms_cutime = user
// WASI doesn't provide a way to spawn a new process, so always 0.
.tms_cutime = 0
};
__wasi_timestamp_t realtime = 0;

Loading…
Cancel
Save