| ... | ... | @@ -616,6 +616,7 @@ pub const IO_Uring = struct { |
| 616 | 616 | |
| 617 | 617 | /// Queues (but does not submit) an SQE to perform a `recv(2)`. |
| 618 | 618 | /// Returns a pointer to the SQE. |
| 619 | /// Available since 5.6 |
| 619 | 620 | pub fn recv( |
| 620 | 621 | self: *IO_Uring, |
| 621 | 622 | user_data: u64, |
| ... | ... | @@ -639,6 +640,7 @@ pub const IO_Uring = struct { |
| 639 | 640 | |
| 640 | 641 | /// Queues (but does not submit) an SQE to perform a `send(2)`. |
| 641 | 642 | /// Returns a pointer to the SQE. |
| 643 | /// Available since 5.6 |
| 642 | 644 | pub fn send( |
| 643 | 645 | self: *IO_Uring, |
| 644 | 646 | user_data: u64, |
| ... | ... | @@ -654,6 +656,7 @@ pub const IO_Uring = struct { |
| 654 | 656 | |
| 655 | 657 | /// Queues (but does not submit) an SQE to perform an async zerocopy `send(2)`. |
| 656 | 658 | /// Returns a pointer to the SQE. |
| 659 | /// Available since 6.0 |
| 657 | 660 | pub fn send_zc( |
| 658 | 661 | self: *IO_Uring, |
| 659 | 662 | user_data: u64, |
| ... | ... | @@ -670,6 +673,7 @@ pub const IO_Uring = struct { |
| 670 | 673 | |
| 671 | 674 | /// Queues (but does not submit) an SQE to perform an async zerocopy `send(2)`. |
| 672 | 675 | /// Returns a pointer to the SQE. |
| 676 | /// Available since 6.0 |
| 673 | 677 | pub fn send_zc_fixed( |
| 674 | 678 | self: *IO_Uring, |
| 675 | 679 | user_data: u64, |
| ... | ... | @@ -687,6 +691,7 @@ pub const IO_Uring = struct { |
| 687 | 691 | |
| 688 | 692 | /// Queues (but does not submit) an SQE to perform a `recvmsg(2)`. |
| 689 | 693 | /// Returns a pointer to the SQE. |
| 694 | /// Available since 5.3 |
| 690 | 695 | pub fn recvmsg( |
| 691 | 696 | self: *IO_Uring, |
| 692 | 697 | user_data: u64, |
| ... | ... | @@ -702,6 +707,7 @@ pub const IO_Uring = struct { |
| 702 | 707 | |
| 703 | 708 | /// Queues (but does not submit) an SQE to perform a `sendmsg(2)`. |
| 704 | 709 | /// Returns a pointer to the SQE. |
| 710 | /// Available since 5.3 |
| 705 | 711 | pub fn sendmsg( |
| 706 | 712 | self: *IO_Uring, |
| 707 | 713 | user_data: u64, |
| ... | ... | @@ -717,6 +723,7 @@ pub const IO_Uring = struct { |
| 717 | 723 | |
| 718 | 724 | /// Queues (but does not submit) an SQE to perform an async zerocopy `sendmsg(2)`. |
| 719 | 725 | /// Returns a pointer to the SQE. |
| 726 | /// Available since 6.1 |
| 720 | 727 | pub fn sendmsg_zc( |
| 721 | 728 | self: *IO_Uring, |
| 722 | 729 | user_data: u64, |
| ... | ... | @@ -3783,13 +3790,9 @@ test "accept multishot" { |
| 3783 | 3790 | } |
| 3784 | 3791 | |
| 3785 | 3792 | test "accept/connect/send_zc/recv" { |
| 3786 | | if (builtin.os.tag != .linux) return error.SkipZigTest; |
| 3793 | try skipKernelLessThan(.{ .major = 6, .minor = 0, .patch = 0 }); |
| 3787 | 3794 | |
| 3788 | | var ring = IO_Uring.init(16, 0) catch |err| switch (err) { |
| 3789 | | error.SystemOutdated => return error.SkipZigTest, |
| 3790 | | error.PermissionDenied => return error.SkipZigTest, |
| 3791 | | else => return err, |
| 3792 | | }; |
| 3795 | var ring = try IO_Uring.init(16, 0); |
| 3793 | 3796 | defer ring.deinit(); |
| 3794 | 3797 | |
| 3795 | 3798 | const socket_test_harness = try createSocketTestHarness(&ring); |
| ... | ... | @@ -3811,7 +3814,6 @@ test "accept/connect/send_zc/recv" { |
| 3811 | 3814 | // request, with the user_data field set to the same value. |
| 3812 | 3815 | // buffer_send must be keep alive until second cqe. |
| 3813 | 3816 | var cqe_send = try ring.copy_cqe(); |
| 3814 | | if (cqe_send.err() == .INVAL) return error.SkipZigTest; |
| 3815 | 3817 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3816 | 3818 | .user_data = 0xeeeeeeee, |
| 3817 | 3819 | .res = buffer_send.len, |
| ... | ... | @@ -3819,7 +3821,6 @@ test "accept/connect/send_zc/recv" { |
| 3819 | 3821 | }, cqe_send); |
| 3820 | 3822 | |
| 3821 | 3823 | const cqe_recv = try ring.copy_cqe(); |
| 3822 | | if (cqe_recv.err() == .INVAL) return error.SkipZigTest; |
| 3823 | 3824 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3824 | 3825 | .user_data = 0xffffffff, |
| 3825 | 3826 | .res = buffer_recv.len, |
| ... | ... | @@ -3831,7 +3832,6 @@ test "accept/connect/send_zc/recv" { |
| 3831 | 3832 | // Second completion of zero-copy send. |
| 3832 | 3833 | // IORING_CQE_F_NOTIF in flags signals that kernel is done with send_buffer |
| 3833 | 3834 | cqe_send = try ring.copy_cqe(); |
| 3834 | | if (cqe_send.err() == .INVAL) return error.SkipZigTest; |
| 3835 | 3835 | try testing.expectEqual(linux.io_uring_cqe{ |
| 3836 | 3836 | .user_data = 0xeeeeeeee, |
| 3837 | 3837 | .res = 0, |