Skip to content

Commit ababd46

Browse files
committed
Merge archs that have the same Pipe2 flags
Signed-off-by: Bernard Assan <mega.alpha100@gmail.com>
1 parent ad7c24e commit ababd46

1 file changed

Lines changed: 3 additions & 26 deletions

File tree

lib/std/os/linux.zig

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,9 @@ pub const O = switch (native_arch) {
497497
};
498498

499499
/// flags for `pipe2` and `IoUring.pipe`
500+
/// matches flags in `O` but specific to `pipe2` syscall
500501
pub const Pipe2 = switch (native_arch) {
501-
.x86_64, .x86, .riscv32, .riscv64, .loongarch64 => packed struct(u32) {
502+
.x86_64, .x86, .riscv32, .riscv64, .loongarch64, .hexagon, .or1k, .s390x => packed struct(u32) {
502503
_: u7 = 0,
503504
notification_pipe: bool = false,
504505
_9: u3 = 0,
@@ -509,7 +510,7 @@ pub const Pipe2 = switch (native_arch) {
509510
cloexec: bool = false,
510511
_21: u12 = 0,
511512
},
512-
.aarch64, .aarch64_be, .arm, .armeb, .thumb, .thumbeb => packed struct(u32) {
513+
.aarch64, .aarch64_be, .arm, .armeb, .thumb, .thumbeb, .m68k => packed struct(u32) {
513514
_: u7 = 0,
514515
notification_pipe: bool = false,
515516
_9: u3 = 0,
@@ -553,30 +554,6 @@ pub const Pipe2 = switch (native_arch) {
553554
cloexec: bool = false,
554555
_21: u12 = 0,
555556
},
556-
// matches `x86_64` above check if the full struct matches
557-
.hexagon, .or1k, .s390x => packed struct(u32) {
558-
_: u7 = 0,
559-
notification_pipe: bool = false,
560-
_9: u3 = 0,
561-
nonblock: bool = false,
562-
_13: u2 = 0,
563-
direct: bool = false,
564-
_16: u4 = 0,
565-
cloexec: bool = false,
566-
_21: u12 = 0,
567-
},
568-
// matches `aarch64` above check if the full struct matches
569-
.m68k => packed struct(u32) {
570-
_: u7 = 0,
571-
notification_pipe: bool = false,
572-
_9: u3 = 0,
573-
nonblock: bool = false,
574-
_13: u4 = 0,
575-
direct: bool = false,
576-
_18: u2 = 0,
577-
cloexec: bool = false,
578-
_21: u12 = 0,
579-
},
580557
else => @compileError("missing std.os.linux.Pipe2 flags for this architecture"),
581558
};
582559

0 commit comments

Comments
 (0)