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.
This commit is contained in:
Linus Groh 2025-07-30 23:27:32 +01:00
parent f5e9384335
commit 813a0f125e
2 changed files with 2 additions and 1 deletions

View File

@ -8604,7 +8604,7 @@ pub const O = switch (native_os) {
},
// https://github.com/SerenityOS/serenity/blob/2808b0376406a40e31293bb3bcb9170374e90506/Kernel/API/POSIX/fcntl.h#L28-L43
.serenity => packed struct(c_int) {
ACCMODE: std.posix.ACCMODE = .RDONLY,
ACCMODE: std.posix.ACCMODE = .NONE,
EXEC: bool = false,
CREAT: bool = false,
EXCL: bool = false,

View File

@ -204,6 +204,7 @@ pub const ACCMODE = switch (native_os) {
// implements this suggestion.
// https://github.com/SerenityOS/serenity/blob/4adc51fdf6af7d50679c48b39362e062f5a3b2cb/Kernel/API/POSIX/fcntl.h#L28-L30
.serenity => enum(u2) {
NONE = 0,
RDONLY = 1,
WRONLY = 2,
RDWR = 3,