Skip to content

Commit 67080fa

Browse files
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.
1 parent 320bbbc commit 67080fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libc-bottom-half/clocks/times.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ clock_t times(struct tms *buffer) {
1717
__wasi_timestamp_t user = __clock();
1818
*buffer = (struct tms){
1919
.tms_utime = user,
20-
.tms_cutime = user
20+
// WASI doesn't provide a way to spawn a new process, so always 0.
21+
.tms_cutime = 0
2122
};
2223

2324
__wasi_timestamp_t realtime = 0;

0 commit comments

Comments
 (0)