Skip to content

Conversation

@IntegratedQuantum
Copy link
Contributor

It appears that the sendto function was removed from std.os.windows.

This changes it to use system.sendto, system is also used for other socket functions such as recvfrom

Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this fixes anything?

/// A libc-compatible API layer.
pub const system = if (use_libc)
    std.c
else switch (native_os) {
    .linux => linux,
    .plan9 => std.os.plan9,
    else => struct {
        pub const ucontext_t = void;
        pub const pid_t = void;
        pub const pollfd = void;
        pub const fd_t = void;
        pub const uid_t = void;
        pub const gid_t = void;
    },
};

IntegratedQuantum added a commit to PixelGuys/Cubyz that referenced this pull request Jul 15, 2025
For reference: ziglang/zig#24329

some commits have been extracted from #1583, but the x86_64 backend has
been disabled due to its horrible performance.

Remaining work:
- [x] Wait for official builds on ziglang.org and upload them to our
repository
- [x] Add workaround for ziglang/zig#24466
- [x] Fix TODO comment about ANSI support in stdout
- [x] Check for compile-time performance changes → it went from 13.1 to
11.9 seconds 🎉
@andrewrk andrewrk closed this Jul 15, 2025
@IntegratedQuantum
Copy link
Contributor Author

I don't see how this fixes anything?

sendto is part of std.c:

zig/lib/std/c.zig

Lines 10620 to 10627 in d4a191f

pub extern "c" fn sendto(
sockfd: fd_t,
buf: *const anyopaque,
len: usize,
flags: u32,
dest_addr: ?*const sockaddr,
addrlen: socklen_t,
) isize;

@andrewrk
Copy link
Member

Even when linking libc, Zig std lib bypasses libc for most stuff on Windows, because libc on Windows is pretty crap. I'll fix this...

@andrewrk
Copy link
Member

5f6e324

@IntegratedQuantum
Copy link
Contributor Author

thanks

@IntegratedQuantum IntegratedQuantum deleted the fix_posix_sendto branch July 15, 2025 21:30
@andrewrk
Copy link
Member

Sorry for the trouble. Those functions will be deleted eventually when I properly tackle #6600 but it's not time yet.

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.

2 participants