std.os.linux: sched_setaffinity fix (#20357)

This commit is contained in:
Gabor Lekeny 2024-07-21 11:39:28 +02:00 committed by GitHub
parent d263f1ec0e
commit 1dbee05609
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1940,7 +1940,7 @@ pub fn sched_setaffinity(pid: pid_t, set: *const cpu_set_t) !void {
const size = @sizeOf(cpu_set_t);
const rc = syscall3(.sched_setaffinity, @as(usize, @bitCast(@as(isize, pid))), size, @intFromPtr(set));
switch (std.os.errno(rc)) {
switch (E.init(rc)) {
.SUCCESS => return,
else => |err| return std.posix.unexpectedErrno(err),
}