authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-05 20:31:31-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-05 20:31:31-08:00
log06130c5e61160b20305c9e6a621fa1c4d0df7858
tree13057f5eec03fdb2182cc012e6b1b2941ae30caa
parentf9a5b34e67ab12a46110568f75a99cb3aa6628c4

std.Io.Threaded: set O_DIRECTORY along with O_TMPFILE


3 files changed, 12 insertions(+), 0 deletions(-)

lib/std/Io/Threaded.zig+2
...@@ -3433,11 +3433,13 @@ fn dirCreateFileAtomic(...@@ -3433,11 +3433,13 @@ fn dirCreateFileAtomic(
3433 const flags: posix.O = if (@hasField(posix.O, "TMPFILE")) .{3433 const flags: posix.O = if (@hasField(posix.O, "TMPFILE")) .{
3434 .ACCMODE = .RDWR,3434 .ACCMODE = .RDWR,
3435 .TMPFILE = true,3435 .TMPFILE = true,
3436 .DIRECTORY = true,
3436 .CLOEXEC = true,3437 .CLOEXEC = true,
3437 } else if (@hasField(posix.O, "TMPFILE0") and !@hasField(posix.O, "TMPFILE2")) .{3438 } else if (@hasField(posix.O, "TMPFILE0") and !@hasField(posix.O, "TMPFILE2")) .{
3438 .ACCMODE = .RDWR,3439 .ACCMODE = .RDWR,
3439 .TMPFILE0 = true,3440 .TMPFILE0 = true,
3440 .TMPFILE1 = true,3441 .TMPFILE1 = true,
3442 .DIRECTORY = true,
3441 .CLOEXEC = true,3443 .CLOEXEC = true,
3442 } else break :tmpfile;3444 } else break :tmpfile;
34433445
lib/std/c.zig+2
...@@ -8427,6 +8427,7 @@ pub const O = switch (native_os) {...@@ -8427,6 +8427,7 @@ pub const O = switch (native_os) {
8427 CLOEXEC: bool = false,8427 CLOEXEC: bool = false,
8428 SYNC: bool = false,8428 SYNC: bool = false,
8429 PATH: bool = false,8429 PATH: bool = false,
8430 /// This is typically invalid without also setting `DIRECTORY`.
8430 TMPFILE: bool = false,8431 TMPFILE: bool = false,
8431 _: u9 = 0,8432 _: u9 = 0,
8432 },8433 },
...@@ -8615,6 +8616,7 @@ pub const O = switch (native_os) {...@@ -8615,6 +8616,7 @@ pub const O = switch (native_os) {
8615 _19: u1 = 0,8616 _19: u1 = 0,
8616 CLOEXEC: bool = false,8617 CLOEXEC: bool = false,
8617 PATH: bool = false,8618 PATH: bool = false,
8619 /// This is typically invalid without also setting `DIRECTORY`.
8618 TMPFILE: bool = false,8620 TMPFILE: bool = false,
8619 _: u9 = 0,8621 _: u9 = 0,
8620 },8622 },
lib/std/os/linux.zig+8
...@@ -324,6 +324,7 @@ pub const O = switch (native_arch) {...@@ -324,6 +324,7 @@ pub const O = switch (native_arch) {
324 CLOEXEC: bool = false,324 CLOEXEC: bool = false,
325 SYNC: bool = false,325 SYNC: bool = false,
326 PATH: bool = false,326 PATH: bool = false,
327 /// This is typically invalid without also setting `DIRECTORY`.
327 TMPFILE: bool = false,328 TMPFILE: bool = false,
328 _23: u9 = 0,329 _23: u9 = 0,
329 },330 },
...@@ -346,6 +347,7 @@ pub const O = switch (native_arch) {...@@ -346,6 +347,7 @@ pub const O = switch (native_arch) {
346 CLOEXEC: bool = false,347 CLOEXEC: bool = false,
347 SYNC: bool = false,348 SYNC: bool = false,
348 PATH: bool = false,349 PATH: bool = false,
350 /// This is typically invalid without also setting `DIRECTORY`.
349 TMPFILE: bool = false,351 TMPFILE: bool = false,
350 _23: u9 = 0,352 _23: u9 = 0,
351 },353 },
...@@ -368,6 +370,7 @@ pub const O = switch (native_arch) {...@@ -368,6 +370,7 @@ pub const O = switch (native_arch) {
368 CLOEXEC: bool = false,370 CLOEXEC: bool = false,
369 SYNC: bool = false,371 SYNC: bool = false,
370 PATH: bool = false,372 PATH: bool = false,
373 /// This is typically invalid without also setting `DIRECTORY`.
371 TMPFILE: bool = false,374 TMPFILE: bool = false,
372 _23: u9 = 0,375 _23: u9 = 0,
373 },376 },
...@@ -393,6 +396,7 @@ pub const O = switch (native_arch) {...@@ -393,6 +396,7 @@ pub const O = switch (native_arch) {
393 CLOEXEC: bool = false,396 CLOEXEC: bool = false,
394 SYNC: bool = false,397 SYNC: bool = false,
395 PATH: bool = false,398 PATH: bool = false,
399 /// This is typically invalid without also setting `DIRECTORY`.
396 TMPFILE: bool = false,400 TMPFILE: bool = false,
397 _27: u6 = 0,401 _27: u6 = 0,
398 },402 },
...@@ -417,6 +421,7 @@ pub const O = switch (native_arch) {...@@ -417,6 +421,7 @@ pub const O = switch (native_arch) {
417 CLOEXEC: bool = false,421 CLOEXEC: bool = false,
418 _20: u1 = 0,422 _20: u1 = 0,
419 PATH: bool = false,423 PATH: bool = false,
424 /// This is typically invalid without also setting `DIRECTORY`.
420 TMPFILE: bool = false,425 TMPFILE: bool = false,
421 _23: u9 = 0,426 _23: u9 = 0,
422 },427 },
...@@ -439,6 +444,7 @@ pub const O = switch (native_arch) {...@@ -439,6 +444,7 @@ pub const O = switch (native_arch) {
439 CLOEXEC: bool = false,444 CLOEXEC: bool = false,
440 SYNC: bool = false,445 SYNC: bool = false,
441 PATH: bool = false,446 PATH: bool = false,
447 /// This is typically invalid without also setting `DIRECTORY`.
442 TMPFILE: bool = false,448 TMPFILE: bool = false,
443 _23: u9 = 0,449 _23: u9 = 0,
444 },450 },
...@@ -459,9 +465,11 @@ pub const O = switch (native_arch) {...@@ -459,9 +465,11 @@ pub const O = switch (native_arch) {
459 NOFOLLOW: bool = false,465 NOFOLLOW: bool = false,
460 NOATIME: bool = false,466 NOATIME: bool = false,
461 CLOEXEC: bool = false,467 CLOEXEC: bool = false,
468 /// This is typically invalid without also setting `TMPFILE1` and `DIRECTORY`.
462 TMPFILE0: bool = false,469 TMPFILE0: bool = false,
463 PATH: bool = false,470 PATH: bool = false,
464 _22: u4 = 0,471 _22: u4 = 0,
472 /// This is typically invalid without also setting `TMPFILE0` and `DIRECTORY`.
465 TMPFILE1: bool = false,473 TMPFILE1: bool = false,
466 _27: u5 = 0,474 _27: u5 = 0,
467475