[wasi-common] Log string representation of WASI errno at the trace level (#760)
* Log str repr of WASI errno at trace level
This commit refactors `Error` enum, and adds logging of the WASI
errno string representation at the trace level. Now, when tracing
WASI syscalls, we will be greeted with a nicely formatted errno
value after each syscall:
```
path_open(...)
| *fd=5
| errno=ESUCCESS
```
This commit gets rid of `errno_from_nix`, `errno_from_win` and
`errno_from_host` helper fns in favour of direct `From` implementations
for the relevant types such as `yanix::Errno` and `winx::winerror::WinError`.
`errno_from_host` is replaced by a trait `FromRawOsError`.
* Back port changes to snapshot0
* Fix indentation in logs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
use crate::ctx::WasiCtx;
|
||||
use crate::{hostcalls_impl, wasi, wasi32};
|
||||
use crate::{wasi, wasi32};
|
||||
|
||||
hostcalls! {
|
||||
pub unsafe fn fd_close(wasi_ctx: &mut WasiCtx, memory: &mut [u8], fd: wasi::__wasi_fd_t,) -> wasi::__wasi_errno_t;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#![allow(non_camel_case_types)]
|
||||
use crate::ctx::WasiCtx;
|
||||
use crate::{hostcalls_impl, wasi, wasi32};
|
||||
use crate::{wasi, wasi32};
|
||||
use log::trace;
|
||||
use wasi_common_cbindgen::wasi_common_cbindgen;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user