@@ -496,159 +496,88 @@ pub const O = switch (native_arch) {
496496 else = > @compileError ("missing std.os.linux.O constants for this architecture" ),
497497};
498498
499+ /// flags for `pipe2` and `IoUring.pipe`
499500pub const Pipe2 = switch (native_arch ) {
500501 .x86_64 , .x86 , .riscv32 , .riscv64 , .loongarch64 = > packed struct (u32 ) {
501502 _ : u7 = 0 ,
502- EXCL : bool = false , //
503+ notification_pipe : bool = false ,
503504 _9 : u3 = 0 ,
504- NONBLOCK : bool = false , //
505+ nonblock : bool = false ,
505506 _13 : u2 = 0 ,
506- DIRECT : bool = false , //
507+ direct : bool = false ,
507508 _16 : u4 = 0 ,
508- CLOEXEC : bool = false , //
509+ cloexec : bool = false ,
509510 _21 : u12 = 0 ,
510511 },
511512 .aarch64 , .aarch64_be , .arm , .armeb , .thumb , .thumbeb = > packed struct (u32 ) {
512- ACCMODE : ACCMODE = .RDONLY ,
513- _2 : u4 = 0 ,
514- CREAT : bool = false ,
515- EXCL : bool = false , //
516- NOCTTY : bool = false ,
517- TRUNC : bool = false ,
518- APPEND : bool = false ,
519- NONBLOCK : bool = false , //
520- DSYNC : bool = false ,
521- ASYNC : bool = false ,
522- DIRECTORY : bool = false ,
523- NOFOLLOW : bool = false ,
524- DIRECT : bool = false , //
525- LARGEFILE : bool = false ,
526- NOATIME : bool = false ,
527- CLOEXEC : bool = false , //
528- SYNC : bool = false ,
529- PATH : bool = false ,
530- TMPFILE : bool = false ,
531- _23 : u9 = 0 ,
513+ _ : u7 = 0 ,
514+ notification_pipe : bool = false ,
515+ _9 : u3 = 0 ,
516+ nonblock : bool = false ,
517+ _13 : u4 = 0 ,
518+ direct : bool = false ,
519+ _18 : u2 = 0 ,
520+ cloexec : bool = false ,
521+ _21 : u12 = 0 ,
532522 },
533523 .sparc64 = > packed struct (u32 ) {
534- ACCMODE : ACCMODE = .RDONLY ,
535- _2 : u1 = 0 ,
536- APPEND : bool = false ,
537- _4 : u2 = 0 ,
538- ASYNC : bool = false ,
539- _7 : u2 = 0 ,
540- CREAT : bool = false ,
541- TRUNC : bool = false ,
542- EXCL : bool = false , //
543- _12 : u1 = 0 ,
544- DSYNC : bool = false ,
545- NONBLOCK : bool = false , //
546- NOCTTY : bool = false ,
547- DIRECTORY : bool = false ,
548- NOFOLLOW : bool = false ,
549- _18 : u2 = 0 ,
550- DIRECT : bool = false , //
551- NOATIME : bool = false ,
552- CLOEXEC : bool = false , //
553- SYNC : bool = false ,
554- PATH : bool = false ,
555- TMPFILE : bool = false ,
556- _27 : u6 = 0 ,
524+ _ : u11 = 0 ,
525+ notification_pipe : bool = false ,
526+ _13 : u2 = 0 ,
527+ nonblock : bool = false ,
528+ _16 : u5 = 0 ,
529+ direct : bool = false ,
530+ _22 : u1 = 0 ,
531+ cloexec : bool = false ,
532+ _24 : u9 = 0 ,
557533 },
558534 .mips , .mipsel , .mips64 , .mips64el = > packed struct (u32 ) {
559- ACCMODE : ACCMODE = .RDONLY ,
560- _2 : u1 = 0 ,
561- APPEND : bool = false ,
562- DSYNC : bool = false ,
563- _5 : u2 = 0 ,
564- NONBLOCK : bool = false , //
565- CREAT : bool = false ,
566- TRUNC : bool = false ,
567- EXCL : bool = false , //
568- NOCTTY : bool = false ,
569- ASYNC : bool = false ,
570- LARGEFILE : bool = false ,
571- SYNC : bool = false ,
572- DIRECT : bool = false , //
573- DIRECTORY : bool = false ,
574- NOFOLLOW : bool = false ,
575- NOATIME : bool = false , //
576- CLOEXEC : bool = false ,
577- _20 : u1 = 0 ,
578- PATH : bool = false ,
579- TMPFILE : bool = false ,
580- _23 : u9 = 0 ,
535+ _ : u7 = 0 ,
536+ nonblock : bool = false ,
537+ _9 : u2 = 0 ,
538+ notification_pipe : bool = false ,
539+ _12 : u4 = 0 ,
540+ direct : bool = false ,
541+ _17 : u3 = 0 ,
542+ cloexec : bool = false ,
543+ _21 : u12 = 0 ,
581544 },
582545 .powerpc , .powerpcle , .powerpc64 , .powerpc64le = > packed struct (u32 ) {
583- ACCMODE : ACCMODE = .RDONLY ,
584- _2 : u4 = 0 ,
585- CREAT : bool = false ,
586- EXCL : bool = false , //
587- NOCTTY : bool = false ,
588- TRUNC : bool = false ,
589- APPEND : bool = false ,
590- NONBLOCK : bool = false , //
591- DSYNC : bool = false ,
592- ASYNC : bool = false ,
593- DIRECTORY : bool = false ,
594- NOFOLLOW : bool = false ,
595- LARGEFILE : bool = false ,
596- DIRECT : bool = false , //
597- NOATIME : bool = false ,
598- CLOEXEC : bool = false , //
599- SYNC : bool = false ,
600- PATH : bool = false ,
601- TMPFILE : bool = false ,
602- _23 : u9 = 0 ,
546+ _ : u7 = 0 ,
547+ notification_pipe : bool = false ,
548+ _9 : u3 = 0 ,
549+ nonblock : bool = false ,
550+ _13 : u5 = 0 ,
551+ direct : bool = false ,
552+ _19 : u1 = 0 ,
553+ cloexec : bool = false ,
554+ _21 : u12 = 0 ,
603555 },
556+ // matches `x86_64` above check if the full struct matches
604557 .hexagon , .or1k , .s390x = > packed struct (u32 ) {
605- ACCMODE : ACCMODE = .RDONLY ,
606- _2 : u4 = 0 ,
607- CREAT : bool = false ,
608- EXCL : bool = false , //
609- NOCTTY : bool = false ,
610- TRUNC : bool = false ,
611- APPEND : bool = false ,
612- NONBLOCK : bool = false , //
613- DSYNC : bool = false ,
614- ASYNC : bool = false ,
615- DIRECT : bool = false , //
616- LARGEFILE : bool = false ,
617- DIRECTORY : bool = false ,
618- NOFOLLOW : bool = false ,
619- NOATIME : bool = false ,
620- CLOEXEC : bool = false , //
621- _20 : u1 = 0 ,
622- PATH : bool = false ,
623- _22 : u10 = 0 ,
624-
625- // #define O_RSYNC 04010000
626- // #define O_SYNC 04010000
627- // #define O_TMPFILE 020200000
628- // #define O_NDELAY O_NONBLOCK
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 ,
629567 },
568+ // matches `aarch64` above check if the full struct matches
630569 .m68k = > packed struct (u32 ) {
631- ACCMODE : ACCMODE = .RDONLY ,
632- _2 : u4 = 0 ,
633- CREAT : bool = false ,
634- EXCL : bool = false , //
635- NOCTTY : bool = false ,
636- TRUNC : bool = false ,
637- APPEND : bool = false ,
638- NONBLOCK : bool = false , //
639- DSYNC : bool = false ,
640- ASYNC : bool = false ,
641- DIRECTORY : bool = false ,
642- NOFOLLOW : bool = false ,
643- DIRECT : bool = false , //
644- LARGEFILE : bool = false ,
645- NOATIME : bool = false ,
646- CLOEXEC : bool = false , //
647- _20 : u1 = 0 ,
648- PATH : bool = false ,
649- _22 : u10 = 0 ,
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 ,
650579 },
651- else = > @compileError ("missing std.os.linux.O constants for this architecture" ),
580+ else = > @compileError ("missing std.os.linux.Pipe2 flags for this architecture" ),
652581};
653582
654583/// Set by startup code, used by `getauxval`.
@@ -1425,7 +1354,7 @@ pub fn pipe(fd: *[2]i32) usize {
14251354 }
14261355}
14271356
1428- pub fn pipe2 (fd : * [2 ]i32 , flags : O ) usize {
1357+ pub fn pipe2 (fd : * [2 ]i32 , flags : Pipe2 ) usize {
14291358 return syscall2 (.pipe2 , @intFromPtr (fd ), @as (u32 , @bitCast (flags )));
14301359}
14311360
0 commit comments