sandboxed-system-primitives: make CPT/TCT clock ids optional (#1126)
NuttX doesn't have them.
This commit is contained in:
parent
d7097fbce8
commit
2fe83e29cd
@ -181,15 +181,19 @@ convert_clockid(__wasi_clockid_t in, clockid_t *out)
|
||||
case __WASI_CLOCK_MONOTONIC:
|
||||
*out = CLOCK_MONOTONIC;
|
||||
return true;
|
||||
#if defined(CLOCK_PROCESS_CPUTIME_ID)
|
||||
case __WASI_CLOCK_PROCESS_CPUTIME_ID:
|
||||
*out = CLOCK_PROCESS_CPUTIME_ID;
|
||||
return true;
|
||||
#endif
|
||||
case __WASI_CLOCK_REALTIME:
|
||||
*out = CLOCK_REALTIME;
|
||||
return true;
|
||||
#if defined(CLOCK_THREAD_CPUTIME_ID)
|
||||
case __WASI_CLOCK_THREAD_CPUTIME_ID:
|
||||
*out = CLOCK_THREAD_CPUTIME_ID;
|
||||
return true;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user