Port WASI host types

This commit is contained in:
Jakub Konka
2019-05-07 09:11:00 +02:00
parent 8335484870
commit 2587fa0145
7 changed files with 1296 additions and 313 deletions

View File

@@ -225,12 +225,12 @@ impl WasiCtx {
// validate rights
if !fe.rights_base & rights_base != 0 || !fe.rights_inheriting & rights_inheriting != 0
{
Err(host::__WASI_ENOTCAPABLE as host::__wasi_errno_t)
Err(host::__WASI_ENOTCAPABLE)
} else {
Ok(fe)
}
} else {
Err(host::__WASI_EBADF as host::__wasi_errno_t)
Err(host::__WASI_EBADF)
}
}
@@ -244,7 +244,7 @@ impl WasiCtx {
if let Some(next_fd) = fd.checked_add(1) {
fd = next_fd;
} else {
return Err(host::__WASI_EMFILE as host::__wasi_errno_t);
return Err(host::__WASI_EMFILE);
}
}
self.fds.insert(fd, fe);