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(
34333433 const flags: posix.O = if (@hasField(posix.O, "TMPFILE")) .{
34343434 .ACCMODE = .RDWR,
34353435 .TMPFILE = true,
3436 .DIRECTORY = true,
34363437 .CLOEXEC = true,
34373438 } else if (@hasField(posix.O, "TMPFILE0") and !@hasField(posix.O, "TMPFILE2")) .{
34383439 .ACCMODE = .RDWR,
34393440 .TMPFILE0 = true,
34403441 .TMPFILE1 = true,
3442 .DIRECTORY = true,
34413443 .CLOEXEC = true,
34423444 } else break :tmpfile;
34433445
lib/std/c.zig+2
......@@ -8427,6 +8427,7 @@ pub const O = switch (native_os) {
84278427 CLOEXEC: bool = false,
84288428 SYNC: bool = false,
84298429 PATH: bool = false,
8430 /// This is typically invalid without also setting `DIRECTORY`.
84308431 TMPFILE: bool = false,
84318432 _: u9 = 0,
84328433 },
......@@ -8615,6 +8616,7 @@ pub const O = switch (native_os) {
86158616 _19: u1 = 0,
86168617 CLOEXEC: bool = false,
86178618 PATH: bool = false,
8619 /// This is typically invalid without also setting `DIRECTORY`.
86188620 TMPFILE: bool = false,
86198621 _: u9 = 0,
86208622 },
lib/std/os/linux.zig+8
......@@ -324,6 +324,7 @@ pub const O = switch (native_arch) {
324324 CLOEXEC: bool = false,
325325 SYNC: bool = false,
326326 PATH: bool = false,
327 /// This is typically invalid without also setting `DIRECTORY`.
327328 TMPFILE: bool = false,
328329 _23: u9 = 0,
329330 },
......@@ -346,6 +347,7 @@ pub const O = switch (native_arch) {
346347 CLOEXEC: bool = false,
347348 SYNC: bool = false,
348349 PATH: bool = false,
350 /// This is typically invalid without also setting `DIRECTORY`.
349351 TMPFILE: bool = false,
350352 _23: u9 = 0,
351353 },
......@@ -368,6 +370,7 @@ pub const O = switch (native_arch) {
368370 CLOEXEC: bool = false,
369371 SYNC: bool = false,
370372 PATH: bool = false,
373 /// This is typically invalid without also setting `DIRECTORY`.
371374 TMPFILE: bool = false,
372375 _23: u9 = 0,
373376 },
......@@ -393,6 +396,7 @@ pub const O = switch (native_arch) {
393396 CLOEXEC: bool = false,
394397 SYNC: bool = false,
395398 PATH: bool = false,
399 /// This is typically invalid without also setting `DIRECTORY`.
396400 TMPFILE: bool = false,
397401 _27: u6 = 0,
398402 },
......@@ -417,6 +421,7 @@ pub const O = switch (native_arch) {
417421 CLOEXEC: bool = false,
418422 _20: u1 = 0,
419423 PATH: bool = false,
424 /// This is typically invalid without also setting `DIRECTORY`.
420425 TMPFILE: bool = false,
421426 _23: u9 = 0,
422427 },
......@@ -439,6 +444,7 @@ pub const O = switch (native_arch) {
439444 CLOEXEC: bool = false,
440445 SYNC: bool = false,
441446 PATH: bool = false,
447 /// This is typically invalid without also setting `DIRECTORY`.
442448 TMPFILE: bool = false,
443449 _23: u9 = 0,
444450 },
......@@ -459,9 +465,11 @@ pub const O = switch (native_arch) {
459465 NOFOLLOW: bool = false,
460466 NOATIME: bool = false,
461467 CLOEXEC: bool = false,
468 /// This is typically invalid without also setting `TMPFILE1` and `DIRECTORY`.
462469 TMPFILE0: bool = false,
463470 PATH: bool = false,
464471 _22: u4 = 0,
472 /// This is typically invalid without also setting `TMPFILE0` and `DIRECTORY`.
465473 TMPFILE1: bool = false,
466474 _27: u5 = 0,
467475