#ifndef __wasilibc___errno_values_h
#define __wasilibc___errno_values_h

#include <wasi/api.h>

#define E2BIG __WASI_ERRNO_2BIG
#define EACCES __WASI_ERRNO_ACCES
#define EADDRINUSE __WASI_ERRNO_ADDRINUSE
#define EADDRNOTAVAIL __WASI_ERRNO_ADDRNOTAVAIL
#define EAFNOSUPPORT __WASI_ERRNO_AFNOSUPPORT
#define EAGAIN __WASI_ERRNO_AGAIN
#define EALREADY __WASI_ERRNO_ALREADY
#define EBADF __WASI_ERRNO_BADF
#define EBADMSG __WASI_ERRNO_BADMSG
#define EBUSY __WASI_ERRNO_BUSY
#define ECANCELED __WASI_ERRNO_CANCELED
#define ECHILD __WASI_ERRNO_CHILD
#define ECONNABORTED __WASI_ERRNO_CONNABORTED
#define ECONNREFUSED __WASI_ERRNO_CONNREFUSED
#define ECONNRESET __WASI_ERRNO_CONNRESET
#define EDEADLK __WASI_ERRNO_DEADLK
#define EDESTADDRREQ __WASI_ERRNO_DESTADDRREQ
#define EDOM __WASI_ERRNO_DOM
#define EDQUOT __WASI_ERRNO_DQUOT
#define EEXIST __WASI_ERRNO_EXIST
#define EFAULT __WASI_ERRNO_FAULT
#define EFBIG __WASI_ERRNO_FBIG
#define EHOSTUNREACH __WASI_ERRNO_HOSTUNREACH
#define EIDRM __WASI_ERRNO_IDRM
#define EILSEQ __WASI_ERRNO_ILSEQ
#define EINPROGRESS __WASI_ERRNO_INPROGRESS
#define EINTR __WASI_ERRNO_INTR
#define EINVAL __WASI_ERRNO_INVAL
#define EIO __WASI_ERRNO_IO
#define EISCONN __WASI_ERRNO_ISCONN
#define EISDIR __WASI_ERRNO_ISDIR
#define ELOOP __WASI_ERRNO_LOOP
#define EMFILE __WASI_ERRNO_MFILE
#define EMLINK __WASI_ERRNO_MLINK
#define EMSGSIZE __WASI_ERRNO_MSGSIZE
#define EMULTIHOP __WASI_ERRNO_MULTIHOP
#define ENAMETOOLONG __WASI_ERRNO_NAMETOOLONG
#define ENETDOWN __WASI_ERRNO_NETDOWN
#define ENETRESET __WASI_ERRNO_NETRESET
#define ENETUNREACH __WASI_ERRNO_NETUNREACH
#define ENFILE __WASI_ERRNO_NFILE
#define ENOBUFS __WASI_ERRNO_NOBUFS
#define ENODEV __WASI_ERRNO_NODEV
#define ENOENT __WASI_ERRNO_NOENT
#define ENOEXEC __WASI_ERRNO_NOEXEC
#define ENOLCK __WASI_ERRNO_NOLCK
#define ENOLINK __WASI_ERRNO_NOLINK
#define ENOMEM __WASI_ERRNO_NOMEM
#define ENOMSG __WASI_ERRNO_NOMSG
#define ENOPROTOOPT __WASI_ERRNO_NOPROTOOPT
#define ENOSPC __WASI_ERRNO_NOSPC
#define ENOSYS __WASI_ERRNO_NOSYS
#define ENOTCONN __WASI_ERRNO_NOTCONN
#define ESHUTDOWN __WASI_ERRNO_SHUTDOWN
#define ENOTDIR __WASI_ERRNO_NOTDIR
#define ENOTEMPTY __WASI_ERRNO_NOTEMPTY
#define ENOTRECOVERABLE __WASI_ERRNO_NOTRECOVERABLE
#define ENOTSOCK __WASI_ERRNO_NOTSOCK
#define ENOTSUP __WASI_ERRNO_NOTSUP
#define ENOTTY __WASI_ERRNO_NOTTY
#define ENXIO __WASI_ERRNO_NXIO
#define EOVERFLOW __WASI_ERRNO_OVERFLOW
#define EOWNERDEAD __WASI_ERRNO_OWNERDEAD
#define EPERM __WASI_ERRNO_PERM
#define EPIPE __WASI_ERRNO_PIPE
#define EPROTO __WASI_ERRNO_PROTO
#define EPROTONOSUPPORT __WASI_ERRNO_PROTONOSUPPORT
#define EPROTOTYPE __WASI_ERRNO_PROTOTYPE
#define ERANGE __WASI_ERRNO_RANGE
#define EROFS __WASI_ERRNO_ROFS
#define ESPIPE __WASI_ERRNO_SPIPE
#define ESRCH __WASI_ERRNO_SRCH
#define ESTALE __WASI_ERRNO_STALE
#define ETIMEDOUT __WASI_ERRNO_TIMEDOUT
#define ETXTBSY __WASI_ERRNO_TXTBSY
#define EXDEV __WASI_ERRNO_XDEV
#define ENOTCAPABLE __WASI_ERRNO_NOTCAPABLE
#define EMEMVIOLATION __WASI_ERRNO_MEMVIOLATION
#define EUNKNOWN __WASI_ERRNO_UNKNOWN

#define EPENDING __WASI_ERRNO_PENDING
#define EOPNOTSUPP ENOTSUP
#define EWOULDBLOCK EAGAIN

// The defines below are unused and only provided for compatibility with the error codes defined in common libc implementations.
// If we start using an errorcode, it will be changed to an actual error code.
#define ENOTBLK 200
#define ECHRNG 201
#define EL2NSYNC 202
#define EL3HLT 203
#define EL3RST 204
#define ELNRNG 205
#define EUNATCH 206
#define ENOCSI 207
#define EL2HLT 208
#define EBADE 209
#define EBADR 210
#define EXFULL 211
#define ENOANO 212
#define EBADRQC 213
#define EBADSLT 214
#define EBFONT 215
#define ENOSTR 216
#define ENODATA 217
#define ETIME 218
#define ENOSR 219
#define ENONET 220
#define ENOPKG 221
#define EREMOTE 222
#define EADV 223
#define ESRMNT 224
#define ECOMM 225
#define EDOTDOT 226
#define ENOTUNIQ 227
#define EBADFD 228
#define EREMCHG 229
#define ELIBACC 230
#define ELIBBAD 231
#define ELIBSCN 232
#define ELIBMAX 233
#define ELIBEXEC 234
#define ERESTART 235
#define ESTRPIPE 236
#define EUSERS 237
#define ESOCKTNOSUPPORT 238
#define EPFNOSUPPORT 239
#define ETOOMANYREFS 240
#define EHOSTDOWN 241
#define EUCLEAN 242
#define ENOTNAM 243
#define ENAVAIL 244
#define EISNAM 245
#define EREMOTEIO 246
#define ENOMEDIUM 247
#define EMEDIUMTYPE 248
#define ENOKEY 249
#define EKEYEXPIRED 250
#define EKEYREVOKED 251
#define EKEYREJECTED 252
#define ERFKILL 253
#define EHWPOISON 254

#endif
