Since I've been sporadically updating with zig-bootstrap, I went back to fix and work on one of my older projects. I noticed in the code I'm working on std.os.open and similar have been removed. I decided to just move to the specific functions for std.os.linux.open [1], but between that and std.os.linux.ftruncate [2] the return type of open is usize, and the input of ftruncate takes an i32. Is there any way to handle this correctly, or is this a bug?
I assume I can just do @as(std.os.linux.fd_t, @bitCast(@as(u32, @intCast(open_result)))) since by spec linux open should only return an int [3] and the source seems to agree [4].
Curious what others think before I make an issue for it.
[1] https://github.com/ziglang/zig/blob/master/lib/std/os/linux.zig#L1095
[2] https://github.com/ziglang/zig/blob/master/lib/std/os/linux.zig#L985
[3] https://man7.org/linux/man-pages/man2/open.2.html
[4] https://github.com/torvalds/linux/blob/master/fs/open.c#L1417