authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2025-07-30 23:27:32+01:00
committergravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2025-07-30 23:27:32+01:00
log813a0f125e2619f0a056d675339cab6ce34a2cbf
treea2273fd0700d3b949c86768dcb47f110700a690c
parentf5e938433555fb8cb0719d63e842ea26d012bb1d

std.posix: Default ACCMODE to NONE for serenity

Unlike all other platforms where RDONLY is 0 it does not work as a default for the O flags on serenity - various syscalls other than 'open', e.g. 'pipe', return EINVAL if unexpected bits are set in the flags.

2 files changed, 2 insertions(+), 1 deletions(-)

lib/std/c.zig+1-1
......@@ -8604,7 +8604,7 @@ pub const O = switch (native_os) {
86048604 },
86058605 // https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L28-L43
86068606 .serenity => packed struct(c_int) {
8607 ACCMODE: std.posix.ACCMODE = .RDONLY,
8607 ACCMODE: std.posix.ACCMODE = .NONE,
86088608 EXEC: bool = false,
86098609 CREAT: bool = false,
86108610 EXCL: bool = false,
lib/std/posix.zig+1
......@@ -204,6 +204,7 @@ pub const ACCMODE = switch (native_os) {
204204 // implements this suggestion.
205205 // https://github.com/SerenityOS/serenity/blob/4adc51fdf6af7d50679c48b39362e062f5a3b2cb/Kernel/API/POSIX/fcntl.h#L28-L30
206206 .serenity => enum(u2) {
207 NONE = 0,
207208 RDONLY = 1,
208209 WRONLY = 2,
209210 RDWR = 3,