Skip to content

Commit 813a0f1

Browse files
committed
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.
1 parent f5e9384 commit 813a0f1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/std/c.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

0 commit comments

Comments
 (0)