diff --git a/flake.lock b/flake.lock index 1db3024a6..420f3952c 100644 --- a/flake.lock +++ b/flake.lock @@ -109,11 +109,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1666181436, - "narHash": "sha256-BfVbxHew4bLVXYms5eUiKL7jbaI+Hp6TF2PH2Vb62cg=", + "lastModified": 1666526970, + "narHash": "sha256-qfhQNN36Bc1RNGtIC63Gc2UcE27Y9FQ/+uKuujimKms=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "cf94d6039dd8205e48013eaef619da6a52bdc34e", + "rev": "c6d01ab96647f8dc4b5f99bc2eb71eeec48d1330", "type": "github" }, "original": { diff --git a/src/Pty.zig b/src/Pty.zig index 63b12b132..5025cacf3 100644 --- a/src/Pty.zig +++ b/src/Pty.zig @@ -19,9 +19,6 @@ const c = switch (builtin.os.tag) { }), }; -// https://github.com/ziglang/zig/issues/12944 -const ioctl = if (builtin.os.tag == .macos) c.ioctl else std.c.ioctl; - /// Redeclare this winsize struct so we can just use a Zig struct. This /// layout should be correct on all tested platforms. const winsize = extern struct { @@ -67,7 +64,7 @@ pub fn deinit(self: *Pty) void { /// Return the size of the pty. pub fn getSize(self: Pty) !winsize { var ws: winsize = undefined; - if (ioctl(self.master, c.TIOCGWINSZ, @ptrToInt(&ws)) < 0) + if (c.ioctl(self.master, c.TIOCGWINSZ, @ptrToInt(&ws)) < 0) return error.IoctlFailed; return ws; @@ -75,7 +72,7 @@ pub fn getSize(self: Pty) !winsize { /// Set the size of the pty. pub fn setSize(self: Pty, size: winsize) !void { - if (ioctl(self.master, c.TIOCSWINSZ, @ptrToInt(&size)) < 0) + if (c.ioctl(self.master, c.TIOCSWINSZ, @ptrToInt(&size)) < 0) return error.IoctlFailed; } @@ -86,7 +83,7 @@ pub fn childPreExec(self: Pty) !void { if (setsid() < 0) return error.ProcessGroupFailed; // Set controlling terminal - if (ioctl(self.slave, c.TIOCSCTTY, @as(c_ulong, 0)) < 0) + if (c.ioctl(self.slave, c.TIOCSCTTY, @as(c_ulong, 0)) < 0) return error.SetControllingTerminalFailed; // Can close master/slave pair now