Reproduced problem
std/net/error.wave::net_error_from_native combines Linux, BSD/Darwin and Winsock error numbers in one unconditional table. Numbers overlap across OSes, so an unrelated error can be reported as retryable or as a refused connection.
On Linux, EDEADLK is 35 and ENODATA is 61. This program prints deadlock=3 no_data=5: NET_ERROR_WOULD_BLOCK and NET_ERROR_REFUSED respectively.
import("std::net::error")::{NetError, net_error_from_native};
fun main() -> i32 {
var deadlock: NetError = net_error_from_native(-35);
var no_data: NetError = net_error_from_native(-61);
println("deadlock={} no_data={}", deadlock.kind, no_data.kind);
return 0;
}
Build/run with the repository std installed in the test HOME. Compare the host constants with python3 -c 'import errno; print(errno.EDEADLK, errno.ENODATA)'. Genuine Linux EAGAIN (11) and ECONNREFUSED (111) must continue mapping correctly.
Scope and acceptance
This is a good first issue: the change is a small pure classification function, and tests need no live network connection. Verify each OS table against its own constants rather than inferring them from Linux.
Audited on canonical master 0c67f4cc0c3946cbf708c11ef79db927ec8f054e (same source tree as #502 head). Executable reproductions used Fedora Linux amd64, Wave 0.2.1-pre-beta-dev, LLVM 21.1.8.
Reproduced problem
std/net/error.wave::net_error_from_nativecombines Linux, BSD/Darwin and Winsock error numbers in one unconditional table. Numbers overlap across OSes, so an unrelated error can be reported as retryable or as a refused connection.On Linux,
EDEADLKis 35 andENODATAis 61. This program printsdeadlock=3 no_data=5:NET_ERROR_WOULD_BLOCKandNET_ERROR_REFUSEDrespectively.Build/run with the repository std installed in the test HOME. Compare the host constants with
python3 -c 'import errno; print(errno.EDEADLK, errno.ENODATA)'. Genuine Linux EAGAIN (11) and ECONNREFUSED (111) must continue mapping correctly.Scope and acceptance
native_codeexactly and returnNET_ERROR_OTHERfor codes without an applicable category.This is a good first issue: the change is a small pure classification function, and tests need no live network connection. Verify each OS table against its own constants rather than inferring them from Linux.
Audited on canonical master
0c67f4cc0c3946cbf708c11ef79db927ec8f054e(same source tree as #502 head). Executable reproductions used Fedora Linux amd64, Wave0.2.1-pre-beta-dev, LLVM 21.1.8.