How to SCM_RIGHTS in zig?

i want to send an fd to another process …

does anyone know a library that can send fds over a socket, like pythons socket.send_fds/recv_fds ?

At the moment there isn’t a nice zig std wrapper around the CMSG macros. But there are some links to some other users implementations here: https://codeberg.org/ziglang/zig/issues/30629

Note that they may need patching depending on the zig version you’re using.

I’ve recently submitted some patches fixing the cmsghdr and msghdr structs on non-Linux platforms. I’m now trying to refine the abstraction I’ve built around them so that I can submit it as a proposed solution to this particular issue. Right now I just have a nice while (cmsg.iter()) interface that works for FreeBSD and SCM_RIGHTS, but I’ve hacked some alignments for that.