Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AFNOSUPPORT error to bind #12560

Merged
merged 1 commit into from Sep 1, 2022

Conversation

schmee
Copy link
Sponsor Contributor

@schmee schmee commented Aug 21, 2022

Happens if you do this:

    var socket = try std.os.socket(
        std.c.AF.LOCAL,
        std.c.SOCK.STREAM,
        0
    );

    const sockaddr = std.os.sockaddr.in{
        .port = std.mem.bigToNative(u16, 7777),
        .addr = @as(u32, 0),
    };
    try std.os.bind(socket, @ptrCast(*const std.os.sockaddr, &sockaddr), @sizeOf(@TypeOf(sockaddr)));

@Vexu
Copy link
Member

Vexu commented Aug 21, 2022

Should this return error.AddressFamilyNotSupported instead? Every other case of .AFNOSUPPORT seems to do so.

@schmee schmee force-pushed the add-afnosupport-error-to-bind branch from a38c307 to 4f6bd86 Compare August 21, 2022 21:46
@schmee
Copy link
Sponsor Contributor Author

schmee commented Aug 21, 2022

@Vexu yes, fixed!

@schmee schmee force-pushed the add-afnosupport-error-to-bind branch from 4f6bd86 to 91a35bc Compare August 21, 2022 22:14
@andrewrk andrewrk force-pushed the add-afnosupport-error-to-bind branch from 91a35bc to e012868 Compare September 1, 2022 01:49
@kprotty kprotty merged commit 36f4f32 into ziglang:master Sep 1, 2022
@schmee schmee deleted the add-afnosupport-error-to-bind branch September 1, 2022 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants