Implement a helper for converting &str to CString. (#154)

This commit implements a simple helper for converting `&str` to `CString` and
mapping to the appropriate WASI error.

It also adds a `path_cstring` helper method in `PathGet` where the conversion was
used the most.

Fixes #104.
This commit is contained in:
Peter Huene
2019-10-29 16:30:22 -07:00
committed by Dan Gohman
parent 9a5c53b3ed
commit de71dbec0d
6 changed files with 28 additions and 18 deletions

View File

@@ -14,7 +14,6 @@ lazy_static! {
static ref START_MONOTONIC: Instant = Instant::now();
}
pub(crate) fn clock_res_get(clock_id: host::__wasi_clockid_t) -> Result<host::__wasi_timestamp_t> {
unimplemented!("clock_res_get")
}