| ... | @@ -3215,8 +3215,10 @@ fn dirCreateDirPathOpenWasi( | ... | @@ -3215,8 +3215,10 @@ fn dirCreateDirPathOpenWasi( |
| 3215 | | 3215 | |
| 3216 | fn dirStat(userdata: ?*anyopaque, dir: Dir) Dir.StatError!Dir.Stat { | 3216 | fn dirStat(userdata: ?*anyopaque, dir: Dir) Dir.StatError!Dir.Stat { |
| 3217 | const t: *Threaded = @ptrCast(@alignCast(userdata)); | 3217 | const t: *Threaded = @ptrCast(@alignCast(userdata)); |
| 3218 | const file: File = .{ .handle = dir.handle }; | 3218 | return fileStat(t, .{ |
| 3219 | return fileStat(t, file); | 3219 | .handle = dir.handle, |
| | 3220 | .flags = .{ .nonblocking = false }, |
| | 3221 | }); |
| 3220 | } | 3222 | } |
| 3221 | | 3223 | |
| 3222 | const dirStatFile = switch (native_os) { | 3224 | const dirStatFile = switch (native_os) { |
| ... | @@ -4008,7 +4010,10 @@ fn dirCreateFilePosix( | ... | @@ -4008,7 +4010,10 @@ fn dirCreateFilePosix( |
| 4008 | } | 4010 | } |
| 4009 | } | 4011 | } |
| 4010 | | 4012 | |
| 4011 | return .{ .handle = fd }; | 4013 | return .{ |
| | 4014 | .handle = fd, |
| | 4015 | .flags = .{ .nonblocking = false }, |
| | 4016 | }; |
| 4012 | } | 4017 | } |
| 4013 | | 4018 | |
| 4014 | fn dirCreateFileWindows( | 4019 | fn dirCreateFileWindows( |
| ... | @@ -4138,7 +4143,10 @@ fn dirCreateFileWindows( | ... | @@ -4138,7 +4143,10 @@ fn dirCreateFileWindows( |
| 4138 | errdefer windows.CloseHandle(handle); | 4143 | errdefer windows.CloseHandle(handle); |
| 4139 | | 4144 | |
| 4140 | const exclusive = switch (flags.lock) { | 4145 | const exclusive = switch (flags.lock) { |
| 4141 | .none => return .{ .handle = handle }, | 4146 | .none => return .{ |
| | 4147 | .handle = handle, |
| | 4148 | .flags = .{ .nonblocking = false }, |
| | 4149 | }, |
| 4142 | .shared => false, | 4150 | .shared => false, |
| 4143 | .exclusive => true, | 4151 | .exclusive => true, |
| 4144 | }; | 4152 | }; |
| ... | @@ -4158,7 +4166,10 @@ fn dirCreateFileWindows( | ... | @@ -4158,7 +4166,10 @@ fn dirCreateFileWindows( |
| 4158 | )) { | 4166 | )) { |
| 4159 | .SUCCESS => { | 4167 | .SUCCESS => { |
| 4160 | syscall.finish(); | 4168 | syscall.finish(); |
| 4161 | return .{ .handle = handle }; | 4169 | return .{ |
| | 4170 | .handle = handle, |
| | 4171 | .flags = .{ .nonblocking = false }, |
| | 4172 | }; |
| 4162 | }, | 4173 | }, |
| 4163 | .INSUFFICIENT_RESOURCES => return syscall.fail(error.SystemResources), | 4174 | .INSUFFICIENT_RESOURCES => return syscall.fail(error.SystemResources), |
| 4164 | .LOCK_NOT_GRANTED => return syscall.fail(error.WouldBlock), | 4175 | .LOCK_NOT_GRANTED => return syscall.fail(error.WouldBlock), |
| ... | @@ -4207,7 +4218,10 @@ fn dirCreateFileWasi( | ... | @@ -4207,7 +4218,10 @@ fn dirCreateFileWasi( |
| 4207 | switch (wasi.path_open(dir.handle, lookup_flags, sub_path.ptr, sub_path.len, oflags, base, inheriting, fdflags, &fd)) { | 4218 | switch (wasi.path_open(dir.handle, lookup_flags, sub_path.ptr, sub_path.len, oflags, base, inheriting, fdflags, &fd)) { |
| 4208 | .SUCCESS => { | 4219 | .SUCCESS => { |
| 4209 | syscall.finish(); | 4220 | syscall.finish(); |
| 4210 | return .{ .handle = fd }; | 4221 | return .{ |
| | 4222 | .handle = fd, |
| | 4223 | .flags = .{ .nonblocking = false }, |
| | 4224 | }; |
| 4211 | }, | 4225 | }, |
| 4212 | .INTR => { | 4226 | .INTR => { |
| 4213 | try syscall.checkCancel(); | 4227 | try syscall.checkCancel(); |
| ... | @@ -4302,7 +4316,10 @@ fn dirCreateFileAtomic( | ... | @@ -4302,7 +4316,10 @@ fn dirCreateFileAtomic( |
| 4302 | .SUCCESS => { | 4316 | .SUCCESS => { |
| 4303 | syscall.finish(); | 4317 | syscall.finish(); |
| 4304 | return .{ | 4318 | return .{ |
| 4305 | .file = .{ .handle = @intCast(rc) }, | 4319 | .file = .{ |
| | 4320 | .handle = @intCast(rc), |
| | 4321 | .flags = .{ .nonblocking = false }, |
| | 4322 | }, |
| 4306 | .file_basename_hex = 0, | 4323 | .file_basename_hex = 0, |
| 4307 | .dest_sub_path = dest_path, | 4324 | .dest_sub_path = dest_path, |
| 4308 | .file_open = true, | 4325 | .file_open = true, |
| ... | @@ -4510,7 +4527,10 @@ fn dirOpenFilePosix( | ... | @@ -4510,7 +4527,10 @@ fn dirOpenFilePosix( |
| 4510 | | 4527 | |
| 4511 | if (!flags.allow_directory) { | 4528 | if (!flags.allow_directory) { |
| 4512 | const is_dir = is_dir: { | 4529 | const is_dir = is_dir: { |
| 4513 | const stat = fileStat(t, .{ .handle = fd }) catch |err| switch (err) { | 4530 | const stat = fileStat(t, .{ |
| | 4531 | .handle = fd, |
| | 4532 | .flags = .{ .nonblocking = false }, |
| | 4533 | }) catch |err| switch (err) { |
| 4514 | // The directory-ness is either unknown or unknowable | 4534 | // The directory-ness is either unknown or unknowable |
| 4515 | error.Streaming => break :is_dir false, | 4535 | error.Streaming => break :is_dir false, |
| 4516 | else => |e| return e, | 4536 | else => |e| return e, |
| ... | @@ -4596,7 +4616,10 @@ fn dirOpenFilePosix( | ... | @@ -4596,7 +4616,10 @@ fn dirOpenFilePosix( |
| 4596 | } | 4616 | } |
| 4597 | } | 4617 | } |
| 4598 | | 4618 | |
| 4599 | return .{ .handle = fd }; | 4619 | return .{ |
| | 4620 | .handle = fd, |
| | 4621 | .flags = .{ .nonblocking = false }, |
| | 4622 | }; |
| 4600 | } | 4623 | } |
| 4601 | | 4624 | |
| 4602 | fn dirOpenFileWindows( | 4625 | fn dirOpenFileWindows( |
| ... | @@ -4729,7 +4752,10 @@ pub fn dirOpenFileWtf16( | ... | @@ -4729,7 +4752,10 @@ pub fn dirOpenFileWtf16( |
| 4729 | errdefer w.CloseHandle(handle); | 4752 | errdefer w.CloseHandle(handle); |
| 4730 | | 4753 | |
| 4731 | const exclusive = switch (flags.lock) { | 4754 | const exclusive = switch (flags.lock) { |
| 4732 | .none => return .{ .handle = handle }, | 4755 | .none => return .{ |
| | 4756 | .handle = handle, |
| | 4757 | .flags = .{ .nonblocking = false }, |
| | 4758 | }, |
| 4733 | .shared => false, | 4759 | .shared => false, |
| 4734 | .exclusive => true, | 4760 | .exclusive => true, |
| 4735 | }; | 4761 | }; |
| ... | @@ -4752,7 +4778,10 @@ pub fn dirOpenFileWtf16( | ... | @@ -4752,7 +4778,10 @@ pub fn dirOpenFileWtf16( |
| 4752 | .ACCESS_VIOLATION => |err| return syscall.ntstatusBug(err), // bad io_status_block pointer | 4778 | .ACCESS_VIOLATION => |err| return syscall.ntstatusBug(err), // bad io_status_block pointer |
| 4753 | else => |status| return syscall.unexpectedNtstatus(status), | 4779 | else => |status| return syscall.unexpectedNtstatus(status), |
| 4754 | }; | 4780 | }; |
| 4755 | return .{ .handle = handle }; | 4781 | return .{ |
| | 4782 | .handle = handle, |
| | 4783 | .flags = .{ .nonblocking = false }, |
| | 4784 | }; |
| 4756 | } | 4785 | } |
| 4757 | | 4786 | |
| 4758 | fn dirOpenFileWasi( | 4787 | fn dirOpenFileWasi( |
| ... | @@ -4834,7 +4863,7 @@ fn dirOpenFileWasi( | ... | @@ -4834,7 +4863,7 @@ fn dirOpenFileWasi( |
| 4834 | | 4863 | |
| 4835 | if (!flags.allow_directory) { | 4864 | if (!flags.allow_directory) { |
| 4836 | const is_dir = is_dir: { | 4865 | const is_dir = is_dir: { |
| 4837 | const stat = fileStat(t, .{ .handle = fd }) catch |err| switch (err) { | 4866 | const stat = fileStat(t, .{ .handle = fd, .flags = .{ .nonblocking = false } }) catch |err| switch (err) { |
| 4838 | // The directory-ness is either unknown or unknowable | 4867 | // The directory-ness is either unknown or unknowable |
| 4839 | error.Streaming => break :is_dir false, | 4868 | error.Streaming => break :is_dir false, |
| 4840 | else => |e| return e, | 4869 | else => |e| return e, |
| ... | @@ -4844,7 +4873,10 @@ fn dirOpenFileWasi( | ... | @@ -4844,7 +4873,10 @@ fn dirOpenFileWasi( |
| 4844 | if (is_dir) return error.IsDir; | 4873 | if (is_dir) return error.IsDir; |
| 4845 | } | 4874 | } |
| 4846 | | 4875 | |
| 4847 | return .{ .handle = fd }; | 4876 | return .{ |
| | 4877 | .handle = fd, |
| | 4878 | .flags = .{ .nonblocking = false }, |
| | 4879 | }; |
| 4848 | } | 4880 | } |
| 4849 | | 4881 | |
| 4850 | const dirOpenDir = switch (native_os) { | 4882 | const dirOpenDir = switch (native_os) { |
| ... | @@ -14390,15 +14422,15 @@ fn spawnPosix(t: *Threaded, options: process.SpawnOptions) process.SpawnError!Sp | ... | @@ -14390,15 +14422,15 @@ fn spawnPosix(t: *Threaded, options: process.SpawnOptions) process.SpawnError!Sp |
| 14390 | .pid = pid, | 14422 | .pid = pid, |
| 14391 | .err_fd = err_pipe[0], | 14423 | .err_fd = err_pipe[0], |
| 14392 | .stdin = switch (options.stdin) { | 14424 | .stdin = switch (options.stdin) { |
| 14393 | .pipe => .{ .handle = stdin_pipe[1] }, | 14425 | .pipe => .{ .handle = stdin_pipe[1], .flags = .{ .nonblocking = false } }, |
| 14394 | else => null, | 14426 | else => null, |
| 14395 | }, | 14427 | }, |
| 14396 | .stdout = switch (options.stdout) { | 14428 | .stdout = switch (options.stdout) { |
| 14397 | .pipe => .{ .handle = stdout_pipe[0] }, | 14429 | .pipe => .{ .handle = stdout_pipe[0], .flags = .{ .nonblocking = false } }, |
| 14398 | else => null, | 14430 | else => null, |
| 14399 | }, | 14431 | }, |
| 14400 | .stderr = switch (options.stderr) { | 14432 | .stderr = switch (options.stderr) { |
| 14401 | .pipe => .{ .handle = stderr_pipe[0] }, | 14433 | .pipe => .{ .handle = stderr_pipe[0], .flags = .{ .nonblocking = false } }, |
| 14402 | else => null, | 14434 | else => null, |
| 14403 | }, | 14435 | }, |
| 14404 | }; | 14436 | }; |
| ... | @@ -15052,9 +15084,9 @@ fn processSpawnWindows(userdata: ?*anyopaque, options: process.SpawnOptions) pro | ... | @@ -15052,9 +15084,9 @@ fn processSpawnWindows(userdata: ?*anyopaque, options: process.SpawnOptions) pro |
| 15052 | return .{ | 15084 | return .{ |
| 15053 | .id = piProcInfo.hProcess, | 15085 | .id = piProcInfo.hProcess, |
| 15054 | .thread_handle = piProcInfo.hThread, | 15086 | .thread_handle = piProcInfo.hThread, |
| 15055 | .stdin = if (g_hChildStd_IN_Wr) |h| .{ .handle = h } else null, | 15087 | .stdin = if (g_hChildStd_IN_Wr) |h| .{ .handle = h, .flags = .{ .nonblocking = false } } else null, |
| 15056 | .stdout = if (g_hChildStd_OUT_Rd) |h| .{ .handle = h } else null, | 15088 | .stdout = if (g_hChildStd_OUT_Rd) |h| .{ .handle = h, .flags = .{ .nonblocking = true } } else null, |
| 15057 | .stderr = if (g_hChildStd_ERR_Rd) |h| .{ .handle = h } else null, | 15089 | .stderr = if (g_hChildStd_ERR_Rd) |h| .{ .handle = h, .flags = .{ .nonblocking = true } } else null, |
| 15058 | .request_resource_usage_statistics = options.request_resource_usage_statistics, | 15090 | .request_resource_usage_statistics = options.request_resource_usage_statistics, |
| 15059 | }; | 15091 | }; |
| 15060 | } | 15092 | } |
| ... | @@ -16188,6 +16220,7 @@ fn progressParentFile(userdata: ?*anyopaque) std.Progress.ParentFileError!File { | ... | @@ -16188,6 +16220,7 @@ fn progressParentFile(userdata: ?*anyopaque) std.Progress.ParentFileError!File { |
| 16188 | .pointer => @ptrFromInt(int), | 16220 | .pointer => @ptrFromInt(int), |
| 16189 | else => return error.UnsupportedOperation, | 16221 | else => return error.UnsupportedOperation, |
| 16190 | }, | 16222 | }, |
| | 16223 | .flags = .{ .nonblocking = false }, |
| 16191 | }; | 16224 | }; |
| 16192 | } | 16225 | } |
| 16193 | | 16226 | |