Skip to content

Commit 49c7318

Browse files
mpfaffalexrp
authored andcommitted
Fix implementation of std.os.linux.accept on x86
1 parent 6eb5e56 commit 49c7318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/os/linux.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: *[2]i32) usi
20422042

20432043
pub fn accept(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t) usize {
20442044
if (native_arch == .x86) {
2045-
return socketcall(SC.accept, &[4]usize{ fd, addr, len, 0 });
2045+
return socketcall(SC.accept, &[4]usize{ @as(usize, @bitCast(@as(isize, fd))), @intFromPtr(addr), @intFromPtr(len), 0 });
20462046
}
20472047
return accept4(fd, addr, len, 0);
20482048
}

0 commit comments

Comments
 (0)