@phated and I found that clock_time_get on Windows would return Bad file descriptor when asking for the thread time on Windows, i.e. uvwasi_clock_time_get for UVWASI_CLOCK_THREAD_CPUTIME_ID.
I saw it was just because GetProcessTimes was being called for both processes and threads, but threads specifically need GetThreadTimes.
I added some basic smoke tests (just ensuring the calls don't fail and that the returned times are non-zero), and tested this on a Windows machine and it appears to work.
Let me know if anything else is needed to get this landed 🙂
@phated and I found that
clock_time_get
on Windows would returnBad file descriptor
when asking for the thread time on Windows, i.e.uvwasi_clock_time_get
forUVWASI_CLOCK_THREAD_CPUTIME_ID
.I saw it was just because
GetProcessTimes
was being called for both processes and threads, but threads specifically needGetThreadTimes
.I added some basic smoke tests (just ensuring the calls don't fail and that the returned times are non-zero), and tested this on a Windows machine and it appears to work.
Let me know if anything else is needed to get this landed 🙂