Skip to content

Commit 6af006e

Browse files
committed
Fill out Windows error mapping table
1 parent 7e6c8d2 commit 6af006e

File tree

1 file changed

+60
-3
lines changed

1 file changed

+60
-3
lines changed

src/tools/miri/src/shims/io_error.rs

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,68 @@ const UNIX_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
8282
// <https://github.com/rust-lang/rust/blob/master/library/std/src/sys/pal/windows/mod.rs>.
8383
const WINDOWS_IO_ERROR_TABLE: &[(&str, std::io::ErrorKind)] = {
8484
use std::io::ErrorKind::*;
85-
// FIXME: this is still incomplete.
8685
&[
87-
("ERROR_ACCESS_DENIED", PermissionDenied),
88-
("ERROR_FILE_NOT_FOUND", NotFound),
86+
("WSAEADDRINUSE", AddrInUse),
87+
("WSAEADDRNOTAVAIL", AddrNotAvailable),
88+
("ERROR_ALREADY_EXISTS", AlreadyExists),
89+
("ERROR_FILE_EXISTS", AlreadyExists),
90+
("ERROR_NO_DATA", BrokenPipe),
91+
("WSAECONNABORTED", ConnectionAborted),
92+
("WSAECONNREFUSED", ConnectionRefused),
93+
("WSAECONNRESET", ConnectionReset),
94+
("ERROR_NOT_SAME_DEVICE", CrossesDevices),
95+
("ERROR_POSSIBLE_DEADLOCK", Deadlock),
96+
("ERROR_DIR_NOT_EMPTY", DirectoryNotEmpty),
97+
("ERROR_CANT_RESOLVE_FILENAME", FilesystemLoop),
98+
("ERROR_DISK_QUOTA_EXCEEDED", FilesystemQuotaExceeded),
99+
("WSAEDQUOT", FilesystemQuotaExceeded),
100+
("ERROR_FILE_TOO_LARGE", FileTooLarge),
101+
("ERROR_HOST_UNREACHABLE", HostUnreachable),
102+
("WSAEHOSTUNREACH", HostUnreachable),
103+
("ERROR_INVALID_NAME", InvalidFilename),
104+
("ERROR_BAD_PATHNAME", InvalidFilename),
105+
("ERROR_FILENAME_EXCED_RANGE", InvalidFilename),
89106
("ERROR_INVALID_PARAMETER", InvalidInput),
107+
("WSAEINVAL", InvalidInput),
108+
("ERROR_DIRECTORY_NOT_SUPPORTED", IsADirectory),
109+
("WSAENETDOWN", NetworkDown),
110+
("ERROR_NETWORK_UNREACHABLE", NetworkUnreachable),
111+
("WSAENETUNREACH", NetworkUnreachable),
112+
("ERROR_DIRECTORY", NotADirectory),
113+
("WSAENOTCONN", NotConnected),
114+
("ERROR_FILE_NOT_FOUND", NotFound),
115+
("ERROR_PATH_NOT_FOUND", NotFound),
116+
("ERROR_INVALID_DRIVE", NotFound),
117+
("ERROR_BAD_NETPATH", NotFound),
118+
("ERROR_BAD_NET_NAME", NotFound),
119+
("ERROR_SEEK_ON_DEVICE", NotSeekable),
120+
("ERROR_NOT_ENOUGH_MEMORY", OutOfMemory),
121+
("ERROR_OUTOFMEMORY", OutOfMemory),
122+
("ERROR_ACCESS_DENIED", PermissionDenied),
123+
("WSAEACCES", PermissionDenied),
124+
("ERROR_WRITE_PROTECT", ReadOnlyFilesystem),
125+
("ERROR_BUSY", ResourceBusy),
126+
("ERROR_DISK_FULL", StorageFull),
127+
("ERROR_HANDLE_DISK_FULL", StorageFull),
128+
("WAIT_TIMEOUT", TimedOut),
129+
("WSAETIMEDOUT", TimedOut),
130+
("ERROR_DRIVER_CANCEL_TIMEOUT", TimedOut),
131+
("ERROR_OPERATION_ABORTED", TimedOut),
132+
("ERROR_SERVICE_REQUEST_TIMEOUT", TimedOut),
133+
("ERROR_COUNTER_TIMEOUT", TimedOut),
134+
("ERROR_TIMEOUT", TimedOut),
135+
("ERROR_RESOURCE_CALL_TIMED_OUT", TimedOut),
136+
("ERROR_CTX_MODEM_RESPONSE_TIMEOUT", TimedOut),
137+
("ERROR_CTX_CLIENT_QUERY_TIMEOUT", TimedOut),
138+
("FRS_ERR_SYSVOL_POPULATE_TIMEOUT", TimedOut),
139+
("ERROR_DS_TIMELIMIT_EXCEEDED", TimedOut),
140+
("DNS_ERROR_RECORD_TIMED_OUT", TimedOut),
141+
("ERROR_IPSEC_IKE_TIMED_OUT", TimedOut),
142+
("ERROR_RUNLEVEL_SWITCH_TIMEOUT", TimedOut),
143+
("ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT", TimedOut),
144+
("ERROR_TOO_MANY_LINKS", TooManyLinks),
145+
("ERROR_CALL_NOT_IMPLEMENTED", Unsupported),
146+
("WSAEWOULDBLOCK", WouldBlock),
90147
]
91148
};
92149

0 commit comments

Comments
 (0)