reuse the host::* consts in enum Error

This commit is contained in:
Marcin Mielniczuk
2019-09-08 18:48:59 +02:00
committed by Jakub Konka
parent c5339d01cf
commit 612617b0ba

View File

@@ -5,84 +5,85 @@ use std::fmt;
use std::num::TryFromIntError;
#[derive(Clone, Copy, Debug, Fail)]
#[repr(u16)]
pub enum WasiError {
ESUCCESS = 0,
E2BIG = 1,
EACCES = 2,
EADDRINUSE = 3,
EADDRNOTAVAIL = 4,
EAFNOSUPPORT = 5,
EAGAIN = 6,
EALREADY = 7,
EBADF = 8,
EBADMSG = 9,
EBUSY = 10,
ECANCELED = 11,
ECHILD = 12,
ECONNABORTED = 13,
ECONNREFUSED = 14,
ECONNRESET = 15,
EDEADLK = 16,
EDESTADDRREQ = 17,
EDOM = 18,
EDQUOT = 19,
EEXIST = 20,
EFAULT = 21,
EFBIG = 22,
EHOSTUNREACH = 23,
EIDRM = 24,
EILSEQ = 25,
EINPROGRESS = 26,
EINTR = 27,
EINVAL = 28,
EIO = 29,
EISCONN = 30,
EISDIR = 31,
ELOOP = 32,
EMFILE = 33,
EMLINK = 34,
EMSGSIZE = 35,
EMULTIHOP = 36,
ENAMETOOLONG = 37,
ENETDOWN = 38,
ENETRESET = 39,
ENETUNREACH = 40,
ENFILE = 41,
ENOBUFS = 42,
ENODEV = 43,
ENOENT = 44,
ENOEXEC = 45,
ENOLCK = 46,
ENOLINK = 47,
ENOMEM = 48,
ENOMSG = 49,
ENOPROTOOPT = 50,
ENOSPC = 51,
ENOSYS = 52,
ENOTCONN = 53,
ENOTDIR = 54,
ENOTEMPTY = 55,
ENOTRECOVERABLE = 56,
ENOTSOCK = 57,
ENOTSUP = 58,
ENOTTY = 59,
ENXIO = 60,
EOVERFLOW = 61,
EOWNERDEAD = 62,
EPERM = 63,
EPIPE = 64,
EPROTO = 65,
EPROTONOSUPPORT = 66,
EPROTOTYPE = 67,
ERANGE = 68,
EROFS = 69,
ESPIPE = 70,
ESRCH = 71,
ESTALE = 72,
ETIMEDOUT = 73,
ETXTBSY = 74,
EXDEV = 75,
ENOTCAPABLE = 76,
ESUCCESS = host::__WASI_ESUCCESS,
E2BIG = host::__WASI_E2BIG,
EACCES = host::__WASI_EACCES,
EADDRINUSE = host::__WASI_EADDRINUSE,
EADDRNOTAVAIL = host::__WASI_EADDRNOTAVAIL,
EAFNOSUPPORT = host::__WASI_EAFNOSUPPORT,
EAGAIN = host::__WASI_EAGAIN,
EALREADY = host::__WASI_EALREADY,
EBADF = host::__WASI_EBADF,
EBADMSG = host::__WASI_EBADMSG,
EBUSY = host::__WASI_EBUSY,
ECANCELED = host::__WASI_ECANCELED,
ECHILD = host::__WASI_ECHILD,
ECONNABORTED = host::__WASI_ECONNABORTED,
ECONNREFUSED = host::__WASI_ECONNREFUSED,
ECONNRESET = host::__WASI_ECONNRESET,
EDEADLK = host::__WASI_EDEADLK,
EDESTADDRREQ = host::__WASI_EDESTADDRREQ,
EDOM = host::__WASI_EDOM,
EDQUOT = host::__WASI_EDQUOT,
EEXIST = host::__WASI_EEXIST,
EFAULT = host::__WASI_EFAULT,
EFBIG = host::__WASI_EFBIG,
EHOSTUNREACH = host::__WASI_EHOSTUNREACH,
EIDRM = host::__WASI_EIDRM,
EILSEQ = host::__WASI_EILSEQ,
EINPROGRESS = host::__WASI_EINPROGRESS,
EINTR = host::__WASI_EINTR,
EINVAL = host::__WASI_EINVAL,
EIO = host::__WASI_EIO,
EISCONN = host::__WASI_EISCONN,
EISDIR = host::__WASI_EISDIR,
ELOOP = host::__WASI_ELOOP,
EMFILE = host::__WASI_EMFILE,
EMLINK = host::__WASI_EMLINK,
EMSGSIZE = host::__WASI_EMSGSIZE,
EMULTIHOP = host::__WASI_EMULTIHOP,
ENAMETOOLONG = host::__WASI_ENAMETOOLONG,
ENETDOWN = host::__WASI_ENETDOWN,
ENETRESET = host::__WASI_ENETRESET,
ENETUNREACH = host::__WASI_ENETUNREACH,
ENFILE = host::__WASI_ENFILE,
ENOBUFS = host::__WASI_ENOBUFS,
ENODEV = host::__WASI_ENODEV,
ENOENT = host::__WASI_ENOENT,
ENOEXEC = host::__WASI_ENOEXEC,
ENOLCK = host::__WASI_ENOLCK,
ENOLINK = host::__WASI_ENOLINK,
ENOMEM = host::__WASI_ENOMEM,
ENOMSG = host::__WASI_ENOMSG,
ENOPROTOOPT = host::__WASI_ENOPROTOOPT,
ENOSPC = host::__WASI_ENOSPC,
ENOSYS = host::__WASI_ENOSYS,
ENOTCONN = host::__WASI_ENOTCONN,
ENOTDIR = host::__WASI_ENOTDIR,
ENOTEMPTY = host::__WASI_ENOTEMPTY,
ENOTRECOVERABLE = host::__WASI_ENOTRECOVERABLE,
ENOTSOCK = host::__WASI_ENOTSOCK,
ENOTSUP = host::__WASI_ENOTSUP,
ENOTTY = host::__WASI_ENOTTY,
ENXIO = host::__WASI_ENXIO,
EOVERFLOW = host::__WASI_EOVERFLOW,
EOWNERDEAD = host::__WASI_EOWNERDEAD,
EPERM = host::__WASI_EPERM,
EPIPE = host::__WASI_EPIPE,
EPROTO = host::__WASI_EPROTO,
EPROTONOSUPPORT = host::__WASI_EPROTONOSUPPORT,
EPROTOTYPE = host::__WASI_EPROTOTYPE,
ERANGE = host::__WASI_ERANGE,
EROFS = host::__WASI_EROFS,
ESPIPE = host::__WASI_ESPIPE,
ESRCH = host::__WASI_ESRCH,
ESTALE = host::__WASI_ESTALE,
ETIMEDOUT = host::__WASI_ETIMEDOUT,
ETXTBSY = host::__WASI_ETXTBSY,
EXDEV = host::__WASI_EXDEV,
ENOTCAPABLE = host::__WASI_ENOTCAPABLE,
}
impl WasiError {