| ... | @@ -937,6 +937,8 @@ pub const Dir = struct { | ... | @@ -937,6 +937,8 @@ pub const Dir = struct { |
| 937 | try os.openatZ(self.fd, sub_path, os_flags, 0); | 937 | try os.openatZ(self.fd, sub_path, os_flags, 0); |
| 938 | errdefer os.close(fd); | 938 | errdefer os.close(fd); |
| 939 | | 939 | |
| | 940 | // WASI doesn't have os.flock so we intetinally check OS prior to the inner if block |
| | 941 | // since it is not compiltime-known and we need to avoid undefined symbol in Wasm. |
| 940 | if (builtin.target.os.tag != .wasi) { | 942 | if (builtin.target.os.tag != .wasi) { |
| 941 | if (!has_flock_open_flags and flags.lock != .None) { | 943 | if (!has_flock_open_flags and flags.lock != .None) { |
| 942 | // TODO: integrate async I/O | 944 | // TODO: integrate async I/O |
| ... | @@ -1089,8 +1091,10 @@ pub const Dir = struct { | ... | @@ -1089,8 +1091,10 @@ pub const Dir = struct { |
| 1089 | try os.openatZ(self.fd, sub_path_c, os_flags, flags.mode); | 1091 | try os.openatZ(self.fd, sub_path_c, os_flags, flags.mode); |
| 1090 | errdefer os.close(fd); | 1092 | errdefer os.close(fd); |
| 1091 | | 1093 | |
| | 1094 | // WASI doesn't have os.flock so we intetinally check OS prior to the inner if block |
| | 1095 | // since it is not compiltime-known and we need to avoid undefined symbol in Wasm. |
| 1092 | if (builtin.target.os.tag != .wasi) { | 1096 | if (builtin.target.os.tag != .wasi) { |
| 1093 | if (!has_flock_open_flags and flags.lock != .None and builtin.target.os.tag != .wasi) { | 1097 | if (!has_flock_open_flags and flags.lock != .None) { |
| 1094 | // TODO: integrate async I/O | 1098 | // TODO: integrate async I/O |
| 1095 | const lock_nonblocking = if (flags.lock_nonblocking) os.LOCK_NB else @as(i32, 0); | 1099 | const lock_nonblocking = if (flags.lock_nonblocking) os.LOCK_NB else @as(i32, 0); |
| 1096 | try os.flock(fd, switch (flags.lock) { | 1100 | try os.flock(fd, switch (flags.lock) { |