-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
std.posix AcceptError and ConnectError mismatches since std.Io merge #25767
Copy link
Copy link
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Activity
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorregressionIt worked in a previous version of Zig, but stopped working.It worked in a previous version of Zig, but stopped working.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Zig Version
0.16.0-dev.1187+1d80c9540
Steps to Reproduce and Observed Behavior
My code that calls
std.posix.accept()currently (sincestd.Iomerge) fails to compile due to a mismatch in the error set being used here, vs the switch to using the newAcceptErrorset fromstd.Io.net.In the new
std.Io.Threadedimplementation,.INVALis considered anerrnoBug()case, rather than having this specific error in the union.Similarly,
std.posix.getsockoptError()(which usesConnectErrorfor its set, which similarly moved over tostd.Io.net), is still returning errors that don't match the new union for.ISCONNand.ADDRINUSE. This was already addressed forstd.posix.connectby turning.ADDRINUSEinto an unexpected errno and making.ISCONNissue a panic, so I imagine thatgetsockoptError()should mirror something similar to those choices?I've patched these locally and trivially to get my build working for now, but I'm kind of unsure which of several trivial directions maintainers would rather go on these cleanups. There also might be other related cases, these are just the only ones my specific project tripped on.
Expected Behavior
std.posixnetwork functions don't fail to compile due to mismatched error sets.