File tree Expand file tree Collapse file tree 4 files changed +5
-0
lines changed Expand file tree Collapse file tree 4 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
148148 libc:: ETIMEDOUT => ErrorKind :: TimedOut ,
149149 libc:: EEXIST => ErrorKind :: AlreadyExists ,
150150 libc:: ENOSYS => ErrorKind :: Unsupported ,
151+ libc:: ENOMEM => ErrorKind :: OutOfMemory ,
151152
152153 // These two constants can have the same value on some systems,
153154 // but different values on others, so we can't use a match
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind {
7777 wasi:: ERRNO_EXIST => AlreadyExists ,
7878 wasi:: ERRNO_AGAIN => WouldBlock ,
7979 wasi:: ERRNO_NOSYS => Unsupported ,
80+ wasi:: ERRNO_NOMEM => OutOfMemory ,
8081 _ => Other ,
8182 }
8283}
Original file line number Diff line number Diff line change @@ -168,6 +168,8 @@ pub const ERROR_FILE_NOT_FOUND: DWORD = 2;
168168pub const ERROR_PATH_NOT_FOUND : DWORD = 3 ;
169169pub const ERROR_ACCESS_DENIED : DWORD = 5 ;
170170pub const ERROR_INVALID_HANDLE : DWORD = 6 ;
171+ pub const ERROR_NOT_ENOUGH_MEMORY : DWORD = 8 ;
172+ pub const ERROR_OUTOFMEMORY : DWORD = 14 ;
171173pub const ERROR_NO_MORE_FILES : DWORD = 18 ;
172174pub const ERROR_HANDLE_EOF : DWORD = 38 ;
173175pub const ERROR_FILE_EXISTS : DWORD = 80 ;
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
7171 c:: ERROR_PATH_NOT_FOUND => return ErrorKind :: NotFound ,
7272 c:: ERROR_NO_DATA => return ErrorKind :: BrokenPipe ,
7373 c:: ERROR_INVALID_PARAMETER => return ErrorKind :: InvalidInput ,
74+ c:: ERROR_NOT_ENOUGH_MEMORY | c:: ERROR_OUTOFMEMORY => return ErrorKind :: OutOfMemory ,
7475 c:: ERROR_SEM_TIMEOUT
7576 | c:: WAIT_TIMEOUT
7677 | c:: ERROR_DRIVER_CANCEL_TIMEOUT
You can’t perform that action at this time.
0 commit comments