From ff3f5aa154fd4ee390c87733b6ed61d68a750c33 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 16 Jan 2023 11:22:41 -0800 Subject: Don't open non-blocking on Linux --- src/bun.js/webcore/blob.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/bun.js') diff --git a/src/bun.js/webcore/blob.zig b/src/bun.js/webcore/blob.zig index 6eb0eb7c0..de92aa0f4 100644 --- a/src/bun.js/webcore/blob.zig +++ b/src/bun.js/webcore/blob.zig @@ -926,7 +926,12 @@ pub const Blob = struct { const State = @This(); - const __opener_flags = std.os.O.NONBLOCK | std.os.O.CLOEXEC; + /// This is a workaround for some versions of IO uring returning + /// EAGAIN when reading a file opened with O_NONBLOCK. Since io_uring waits, we don't need to wait. + const non_block_without_io_uring = if (Environment.isLinux) 0 else std.os.O.NONBLOCK; + + const __opener_flags = non_block_without_io_uring | std.os.O.CLOEXEC; + const open_flags_ = if (@hasDecl(This, "open_flags")) This.open_flags | __opener_flags else -- cgit v1.2.3