diff options
author | 2023-01-16 11:22:41 -0800 | |
---|---|---|
committer | 2023-01-16 11:22:54 -0800 | |
commit | ff3f5aa154fd4ee390c87733b6ed61d68a750c33 (patch) | |
tree | 2f03f93b31df5c660747fe8e7a9a15e239ec3f60 /src | |
parent | 91bcfa9cb4ab0c309987fa816fb8b182ec38a228 (diff) | |
download | bun-ff3f5aa154fd4ee390c87733b6ed61d68a750c33.tar.gz bun-ff3f5aa154fd4ee390c87733b6ed61d68a750c33.tar.zst bun-ff3f5aa154fd4ee390c87733b6ed61d68a750c33.zip |
Don't open non-blocking on Linux
Diffstat (limited to 'src')
-rw-r--r-- | src/bun.js/webcore/blob.zig | 7 |
1 files changed, 6 insertions, 1 deletions
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 |