comment on why to not use posix.errno

This commit is contained in:
rhodes-b
2025-02-02 16:35:20 -06:00
parent bc156266c6
commit fb2516fbf6

View File

@ -130,6 +130,7 @@ pub fn cloneInto(cgroup: []const u8) !posix.pid_t {
};
const rc = linux.syscall2(linux.SYS.clone3, @intFromPtr(&args), @sizeOf(@TypeOf(args)));
// do not use posix.errno, when linking libc it will use the libc errno which will not be set when making the syscall directly
return switch (std.os.linux.E.init(rc)) {
.SUCCESS => @as(posix.pid_t, @intCast(rc)),
else => |errno| err: {