zig-network icon indicating copy to clipboard operation
zig-network copied to clipboard

Incorrect NOSIGPIPE mask on Darwin?

Open briangold opened this issue 3 years ago • 0 comments

The current implementation of connect() appears to use a fixed constant (0x800) for all BSD family targets, but the stdlib has this constant defined for targets that support it in std.os.SO.NOSIGPIPE.

In particular, it looks like the constant differs on Darwin (0x1022 vs 0x800), so this might lead to problems.

https://github.com/MasterQ32/zig-network/blob/6f1563af0a6d30e26597133ebc03f162723ea329/network.zig#L344

Seems like you could change the constant to just use std.os.SO.NOSIGPIPE here?

briangold avatar Apr 04 '22 19:04 briangold