From 8515779589c2cc47784dbb3138a1892a40839d7e Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Mon, 11 Oct 2021 04:37:26 +0900 Subject: [PATCH] Fix wasi build --- vm/src/stdlib/errno.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/vm/src/stdlib/errno.rs b/vm/src/stdlib/errno.rs index f465971abe..6c4dc7e321 100644 --- a/vm/src/stdlib/errno.rs +++ b/vm/src/stdlib/errno.rs @@ -59,22 +59,23 @@ const ERROR_CODES: &[(&str, i32)] = &[ cfg(not(any( target_os = "openbsd", target_os = "freebsd", + target_os = "wasi", windows ))), ENODATA ), - e!(cfg(not(windows)), ENOTBLK), + e!(cfg(not(any(windows, target_os = "wasi"))), ENOTBLK), e!(EOPNOTSUPP), e!(ENOSYS), e!(EPIPE), e!(EINVAL), e!(cfg(not(windows)), EOVERFLOW), e!(EINTR), - e!(EUSERS), + e!(cfg(not(target_os = "wasi")), EUSERS), e!(ENOTEMPTY), e!(ENOBUFS), e!(cfg(not(windows)), EPROTO), - e!(EREMOTE), + e!(cfg(not(target_os = "wasi")), EREMOTE), e!(ECHILD), e!(ELOOP), e!(EXDEV), @@ -82,13 +83,13 @@ const ERROR_CODES: &[(&str, i32)] = &[ e!(ESRCH), e!(EMSGSIZE), e!(EAFNOSUPPORT), - e!(EHOSTDOWN), - e!(EPFNOSUPPORT), + e!(cfg(not(target_os = "wasi")), EHOSTDOWN), + e!(cfg(not(target_os = "wasi")), EPFNOSUPPORT), e!(ENOPROTOOPT), e!(EBUSY), e!(EAGAIN), e!(EISCONN), - e!(ESHUTDOWN), + e!(cfg(not(target_os = "wasi")), ESHUTDOWN), e!(EBADF), e!(cfg(not(any(target_os = "openbsd", windows))), EMULTIHOP), e!(EIO), @@ -121,6 +122,7 @@ const ERROR_CODES: &[(&str, i32)] = &[ cfg(not(any( target_os = "openbsd", target_os = "freebsd", + target_os = "wasi", windows ))), ENOSTR @@ -137,6 +139,7 @@ const ERROR_CODES: &[(&str, i32)] = &[ cfg(not(any( target_os = "openbsd", target_os = "freebsd", + target_os = "wasi", windows ))), ENOSR @@ -150,16 +153,17 @@ const ERROR_CODES: &[(&str, i32)] = &[ e!(cfg(not(any(target_os = "redox", windows))), ENOTSUP), e!(ENAMETOOLONG), e!(ENOTTY), - e!(ESOCKTNOSUPPORT), + e!(cfg(not(target_os = "wasi")), ESOCKTNOSUPPORT), e!( cfg(not(any( target_os = "openbsd", target_os = "freebsd", + target_os = "wasi", windows ))), ETIME ), - e!(ETOOMANYREFS), + e!(cfg(not(target_os = "wasi")), ETOOMANYREFS), e!(EMFILE), e!(cfg(not(windows)), ETXTBSY), e!(EINPROGRESS),