Skip to content

Commit

Permalink
Use error code for unsupported WASI clock ID
Browse files Browse the repository at this point in the history
  • Loading branch information
electrum committed Oct 11, 2024
1 parent 7c61556 commit 555e449
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions wasi/src/main/java/com/dylibso/chicory/wasi/WasiPreview1.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,8 @@ public int clockResGet(Memory memory, int clockId, int resultPtr) {
memory.writeLong(resultPtr, 1L);
return wasiResult(WasiErrno.ESUCCESS);
case WasiClockId.PROCESS_CPUTIME_ID:
throw new WASMRuntimeException("We don't yet support clockid process_cputime_id");
case WasiClockId.THREAD_CPUTIME_ID:
throw new WASMRuntimeException("We don't yet support clockid thread_cputime_id");
return wasiResult(WasiErrno.ENOTSUP);
default:
return wasiResult(WasiErrno.EINVAL);
}
Expand All @@ -202,9 +201,8 @@ public int clockTimeGet(Memory memory, int clockId, long precision, int resultPt
memory.writeLong(resultPtr, System.nanoTime());
return wasiResult(WasiErrno.ESUCCESS);
case WasiClockId.PROCESS_CPUTIME_ID:
throw new WASMRuntimeException("We don't yet support clockid process_cputime_id");
case WasiClockId.THREAD_CPUTIME_ID:
throw new WASMRuntimeException("We don't yet support clockid thread_cputime_id");
return wasiResult(WasiErrno.ENOTSUP);
default:
return wasiResult(WasiErrno.EINVAL);
}
Expand Down

0 comments on commit 555e449

Please sign in to comment.