From b59080b943a4021d240848c11231d37e4db998bf Mon Sep 17 00:00:00 2001 From: mochalins <117967760+mochalins@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:49:09 +0900 Subject: [PATCH] fix: flush for macos --- src/backend/posix.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backend/posix.zig b/src/backend/posix.zig index 36c32f1..202a3a7 100644 --- a/src/backend/posix.zig +++ b/src/backend/posix.zig @@ -141,7 +141,12 @@ fn tcflush(fd: std.posix.fd_t, action: TCFLUSH) !void { @intFromEnum(action), ); }, - .macos => try std.c.tcflush(fd, @intFromEnum(action)), + .macos => b: { + const c = @cImport({ + @cInclude("termios.h"); + }); + break :b try c.tcflush(fd, @intFromEnum(action)); + }, else => @compileError("tcflush unimplemented on this OS"), }; return switch (std.posix.errno(result)) {