@@ -559,7 +559,10 @@ pub const AsyncIoUring = struct {
559
559
LinuxError .BADF = > .{ .err = AcceptError .InvalidFd },
560
560
LinuxError .CONNABORTED = > .{ .err = AcceptError .ConnectionAborted },
561
561
LinuxError .FAULT = > .{ .err = AcceptError .InvalidAddress },
562
- LinuxError .INTR = > .{ .err = AcceptError .Interrupted },
562
+ LinuxError .INTR = > {
563
+ try uring .queue_accept (job .task , inner .socket , inner .kind );
564
+ continue ;
565
+ },
563
566
LinuxError .INVAL = > .{ .err = AcceptError .NotListening },
564
567
LinuxError .MFILE = > .{ .err = AcceptError .ProcessFdQuotaExceeded },
565
568
LinuxError .NFILE = > .{ .err = AcceptError .SystemFdQuotaExceeded },
@@ -592,7 +595,10 @@ pub const AsyncIoUring = struct {
592
595
LinuxError .BADF = > .{ .err = ConnectError .InvalidFd },
593
596
LinuxError .CONNREFUSED = > .{ .err = ConnectError .ConnectionRefused },
594
597
LinuxError .FAULT = > .{ .err = ConnectError .InvalidAddress },
595
- LinuxError .INTR = > .{ .err = ConnectError .Interrupted },
598
+ LinuxError .INTR = > {
599
+ try uring .queue_connect (job .task , inner .socket , inner .addr , inner .kind );
600
+ continue ;
601
+ },
596
602
LinuxError .ISCONN = > .{ .err = ConnectError .AlreadyConnected },
597
603
LinuxError .NETUNREACH = > .{ .err = ConnectError .NetworkUnreachable },
598
604
LinuxError .NOTSOCK = > .{ .err = ConnectError .NotASocket },
@@ -604,7 +610,7 @@ pub const AsyncIoUring = struct {
604
610
605
611
break :blk .{ .connect = result };
606
612
},
607
- .recv = > {
613
+ .recv = > | inner | {
608
614
if (cqe .res > 0 ) break :blk .{ .recv = .{ .actual = @intCast (cqe .res ) } };
609
615
if (cqe .res == 0 ) break :blk .{ .recv = .{ .err = RecvError .Closed } };
610
616
@@ -616,7 +622,10 @@ pub const AsyncIoUring = struct {
616
622
LinuxError .CONNRESET = > .{ .err = RecvError .Closed },
617
623
LinuxError .CONNREFUSED = > .{ .err = RecvError .ConnectionRefused },
618
624
LinuxError .FAULT = > .{ .err = RecvError .InvalidAddress },
619
- LinuxError .INTR = > .{ .err = RecvError .Interrupted },
625
+ LinuxError .INTR = > {
626
+ try uring .queue_recv (job .task , inner .socket , inner .buffer );
627
+ continue ;
628
+ },
620
629
LinuxError .INVAL = > .{ .err = RecvError .InvalidArguments },
621
630
LinuxError .NOMEM = > .{ .err = RecvError .OutOfMemory },
622
631
LinuxError .NOTCONN = > .{ .err = RecvError .NotConnected },
@@ -627,7 +636,7 @@ pub const AsyncIoUring = struct {
627
636
628
637
break :blk .{ .recv = result };
629
638
},
630
- .send = > {
639
+ .send = > | inner | {
631
640
if (cqe .res >= 0 ) break :blk .{ .send = .{ .actual = @intCast (cqe .res ) } };
632
641
633
642
const result : SendResult = result : {
@@ -640,7 +649,10 @@ pub const AsyncIoUring = struct {
640
649
LinuxError .CONNRESET , LinuxError .PIPE = > .{ .err = SendError .Closed },
641
650
LinuxError .DESTADDRREQ = > .{ .err = SendError .NoDestinationAddress },
642
651
LinuxError .FAULT = > .{ .err = SendError .InvalidAddress },
643
- LinuxError .INTR = > .{ .err = SendError .Interrupted },
652
+ LinuxError .INTR = > {
653
+ try uring .queue_send (job .task , inner .socket , inner .buffer );
654
+ continue ;
655
+ },
644
656
LinuxError .INVAL = > .{ .err = SendError .InvalidArguments },
645
657
LinuxError .ISCONN = > .{ .err = SendError .AlreadyConnected },
646
658
LinuxError .MSGSIZE = > .{ .err = SendError .InvalidSize },
@@ -653,7 +665,7 @@ pub const AsyncIoUring = struct {
653
665
654
666
break :blk .{ .send = result };
655
667
},
656
- .mkdir = > | _ | {
668
+ .mkdir = > | inner | {
657
669
if (cqe .res == 0 ) break :blk .{ .mkdir = .{ .actual = {} } };
658
670
659
671
const result : MkdirResult = result : {
@@ -667,6 +679,10 @@ pub const AsyncIoUring = struct {
667
679
LinuxError .NOSPC = > .{ .err = MkdirError .NoSpace },
668
680
LinuxError .NOTDIR = > .{ .err = MkdirError .NotADirectory },
669
681
LinuxError .ROFS = > .{ .err = MkdirError .ReadOnlyFileSystem },
682
+ LinuxError .INTR = > {
683
+ try uring .queue_mkdir (job .task , inner .path , inner .mode );
684
+ continue ;
685
+ },
670
686
else = > .{ .err = MkdirError .Unexpected },
671
687
};
672
688
};
@@ -693,7 +709,10 @@ pub const AsyncIoUring = struct {
693
709
LinuxError .EXIST = > .{ .err = OpenError .AlreadyExists },
694
710
LinuxError .FAULT = > .{ .err = OpenError .InvalidAddress },
695
711
LinuxError .FBIG , LinuxError .OVERFLOW = > .{ .err = OpenError .FileTooBig },
696
- LinuxError .INTR = > .{ .err = OpenError .Interrupted },
712
+ LinuxError .INTR = > {
713
+ try uring .queue_open (job .task , inner .path , inner .flags );
714
+ continue ;
715
+ },
697
716
LinuxError .INVAL = > .{ .err = OpenError .InvalidArguments },
698
717
LinuxError .ISDIR = > .{ .err = OpenError .IsDirectory },
699
718
LinuxError .LOOP = > .{ .err = OpenError .Loop },
@@ -715,7 +734,7 @@ pub const AsyncIoUring = struct {
715
734
716
735
break :blk .{ .open = result };
717
736
},
718
- .delete = > {
737
+ .delete = > | inner | {
719
738
if (cqe .res == 0 ) break :blk .{ .delete = .{ .actual = {} } };
720
739
721
740
const result : DeleteResult = result : {
@@ -734,6 +753,10 @@ pub const AsyncIoUring = struct {
734
753
LinuxError .NOTDIR = > .{ .err = DeleteError .IsNotDirectory },
735
754
LinuxError .ROFS = > .{ .err = DeleteError .ReadOnlyFileSystem },
736
755
LinuxError .BADF = > .{ .err = DeleteError .InvalidFd },
756
+ LinuxError .INTR = > {
757
+ try uring .queue_delete (job .task , inner .path , inner .is_dir );
758
+ continue ;
759
+ },
737
760
// rmdir
738
761
LinuxError .INVAL = > .{ .err = DeleteError .InvalidArguments },
739
762
LinuxError .NOTEMPTY = > .{ .err = DeleteError .NotEmpty },
@@ -743,7 +766,7 @@ pub const AsyncIoUring = struct {
743
766
744
767
break :blk .{ .delete = result };
745
768
},
746
- .read = > {
769
+ .read = > | inner | {
747
770
if (cqe .res > 0 ) break :blk .{ .read = .{ .actual = @intCast (cqe .res ) } };
748
771
if (cqe .res == 0 ) break :blk .{ .read = .{ .err = ReadError .EndOfFile } };
749
772
@@ -753,7 +776,10 @@ pub const AsyncIoUring = struct {
753
776
LinuxError .AGAIN = > .{ .err = ReadError .WouldBlock },
754
777
LinuxError .BADF = > .{ .err = ReadError .InvalidFd },
755
778
LinuxError .FAULT = > .{ .err = ReadError .InvalidAddress },
756
- LinuxError .INTR = > .{ .err = ReadError .Interrupted },
779
+ LinuxError .INTR = > {
780
+ try uring .queue_read (job .task , inner .fd , inner .buffer , inner .offset );
781
+ continue ;
782
+ },
757
783
LinuxError .INVAL = > .{ .err = ReadError .InvalidArguments },
758
784
LinuxError .IO = > .{ .err = ReadError .IoError },
759
785
LinuxError .ISDIR = > .{ .err = ReadError .IsDirectory },
@@ -763,7 +789,7 @@ pub const AsyncIoUring = struct {
763
789
764
790
break :blk .{ .read = result };
765
791
},
766
- .write = > {
792
+ .write = > | inner | {
767
793
if (cqe .res > 0 ) break :blk .{ .write = .{ .actual = @intCast (cqe .res ) } };
768
794
769
795
const result : WriteResult = result : {
@@ -775,7 +801,10 @@ pub const AsyncIoUring = struct {
775
801
LinuxError .DQUOT = > .{ .err = WriteError .DiskQuotaExceeded },
776
802
LinuxError .FAULT = > .{ .err = WriteError .InvalidAddress },
777
803
LinuxError .FBIG = > .{ .err = WriteError .FileTooBig },
778
- LinuxError .INTR = > .{ .err = WriteError .Interrupted },
804
+ LinuxError .INTR = > {
805
+ try uring .queue_write (job .task , inner .fd , inner .buffer , inner .offset );
806
+ continue ;
807
+ },
779
808
LinuxError .INVAL = > .{ .err = WriteError .InvalidArguments },
780
809
LinuxError .IO = > .{ .err = WriteError .IoError },
781
810
LinuxError .NOSPC = > .{ .err = WriteError .NoSpace },
@@ -787,7 +816,7 @@ pub const AsyncIoUring = struct {
787
816
788
817
break :blk .{ .write = result };
789
818
},
790
- .stat = > {
819
+ .stat = > | inner | {
791
820
defer uring .allocator .destroy (job_with_data .statx );
792
821
793
822
if (cqe .res == 0 ) {
@@ -818,6 +847,10 @@ pub const AsyncIoUring = struct {
818
847
LinuxError .BADF = > .{ .err = StatError .InvalidFd },
819
848
LinuxError .FAULT = > .{ .err = StatError .InvalidAddress },
820
849
LinuxError .INVAL = > .{ .err = StatError .InvalidArguments },
850
+ LinuxError .INTR = > {
851
+ try uring .queue_stat (job .task , inner );
852
+ continue ;
853
+ },
821
854
LinuxError .LOOP = > .{ .err = StatError .Loop },
822
855
LinuxError .NAMETOOLONG = > .{ .err = StatError .NameTooLong },
823
856
LinuxError .NOENT = > .{ .err = StatError .NotFound },
0 commit comments