std.Io.Threaded: set O_DIRECTORY along with O_TMPFILE

This commit is contained in:
Andrew Kelley 2026-01-05 20:31:31 -08:00
parent f9a5b34e67
commit 06130c5e61
3 changed files with 12 additions and 0 deletions

View file

@ -3433,11 +3433,13 @@ fn dirCreateFileAtomic(
const flags: posix.O = if (@hasField(posix.O, "TMPFILE")) .{
.ACCMODE = .RDWR,
.TMPFILE = true,
.DIRECTORY = true,
.CLOEXEC = true,
} else if (@hasField(posix.O, "TMPFILE0") and !@hasField(posix.O, "TMPFILE2")) .{
.ACCMODE = .RDWR,
.TMPFILE0 = true,
.TMPFILE1 = true,
.DIRECTORY = true,
.CLOEXEC = true,
} else break :tmpfile;

View file

@ -8427,6 +8427,7 @@ pub const O = switch (native_os) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_: u9 = 0,
},
@ -8615,6 +8616,7 @@ pub const O = switch (native_os) {
_19: u1 = 0,
CLOEXEC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_: u9 = 0,
},

View file

@ -324,6 +324,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_23: u9 = 0,
},
@ -346,6 +347,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_23: u9 = 0,
},
@ -368,6 +370,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_23: u9 = 0,
},
@ -393,6 +396,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_27: u6 = 0,
},
@ -417,6 +421,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
_20: u1 = 0,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_23: u9 = 0,
},
@ -439,6 +444,7 @@ pub const O = switch (native_arch) {
CLOEXEC: bool = false,
SYNC: bool = false,
PATH: bool = false,
/// This is typically invalid without also setting `DIRECTORY`.
TMPFILE: bool = false,
_23: u9 = 0,
},
@ -459,9 +465,11 @@ pub const O = switch (native_arch) {
NOFOLLOW: bool = false,
NOATIME: bool = false,
CLOEXEC: bool = false,
/// This is typically invalid without also setting `TMPFILE1` and `DIRECTORY`.
TMPFILE0: bool = false,
PATH: bool = false,
_22: u4 = 0,
/// This is typically invalid without also setting `TMPFILE0` and `DIRECTORY`.
TMPFILE1: bool = false,
_27: u5 = 0,