Skip to content

Commit

Permalink
tweak: don't allow isNonBlocking on Windows
Browse files Browse the repository at this point in the history
Ensure that this function is not called on Windows as it is not
supported being a POSIX only function.
  • Loading branch information
alexkornitzer authored and Alex Kornitzer committed May 31, 2024
1 parent 337df1b commit be1e636
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bun.zig
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ pub fn ensureNonBlocking(fd: anytype) void {
}

pub fn isNonBlocking(fd: anytype) bool {
if (Environment.isWindows) {
@compileError("isNonBlocking() is not supported on Windows");
}
return (std.os.fcntl(fd, std.os.F.GETFL, 0) catch 0 & std.os.O.NONBLOCK) == std.os.O.NONBLOCK;
}

Expand Down

0 comments on commit be1e636

Please sign in to comment.