zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 6fdcf1ad2d860120564f328535903c4c70e30a0d (tree)
parent e5c30eef1f338ed65325ddbfd4d631baef0d9b81
Author: Felix Queißner <git@mq32.de>
Date:   Wed, 23 Feb 2022 08:32:54 +0100

std.os.linux.socketpair: fd is an out parameter


Diffstat:
Mlib/std/os/linux.zig | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig @@ -1269,11 +1269,11 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize { } } -pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: [2]i32) usize { +pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: *[2]i32) usize { if (native_arch == .i386) { - return socketcall(SC.socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]) }); + return socketcall(SC.socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd) }); } - return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0])); + return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(fd)); } pub fn accept(fd: i32, noalias addr: ?*sockaddr, noalias len: ?*socklen_t) usize {