Skip to content

Commit

Permalink
fix: flush for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Sep 15, 2024
1 parent 3a43dae commit b59080b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/backend/posix.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit b59080b

Please sign in to comment.