Skip to content

Commit

Permalink
times should always return 0 for tms_cutime (#510)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
kateinoigakukun authored Jul 3, 2024
1 parent 320bbbc commit 67080fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libc-bottom-half/clocks/times.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 67080fa

Please sign in to comment.