see also send_recv.c:test_invalid */
| 737 | |
| 738 | /* see also send_recv.c:test_invalid */ |
| 739 | static int test_invalid_zc(int fds[2]) |
| 740 | { |
| 741 | struct io_uring ring; |
| 742 | int ret; |
| 743 | struct io_uring_cqe *cqe; |
| 744 | struct io_uring_sqe *sqe; |
| 745 | bool notif = false; |
| 746 | |
| 747 | if (!has_sendmsg) |
| 748 | return 0; |
| 749 | |
| 750 | ret = t_create_ring(8, &ring, 0); |
| 751 | if (ret) |
| 752 | return ret; |
| 753 | |
| 754 | sqe = io_uring_get_sqe(&ring); |
| 755 | io_uring_prep_sendmsg(sqe, fds[0], NULL, MSG_WAITALL); |
| 756 | sqe->opcode = IORING_OP_SENDMSG_ZC; |
| 757 | sqe->flags |= IOSQE_ASYNC; |
| 758 | |
| 759 | ret = io_uring_submit(&ring); |
| 760 | if (ret != 1) { |
| 761 | fprintf(stderr, "submit failed %i\n", ret); |
| 762 | return ret; |
| 763 | } |
| 764 | ret = io_uring_wait_cqe(&ring, &cqe); |
| 765 | if (ret) |
| 766 | return 1; |
| 767 | if (cqe->flags & IORING_CQE_F_MORE) |
| 768 | notif = true; |
| 769 | io_uring_cqe_seen(&ring, cqe); |
| 770 | |
| 771 | if (notif) { |
| 772 | ret = io_uring_wait_cqe(&ring, &cqe); |
| 773 | if (ret) |
| 774 | return 1; |
| 775 | io_uring_cqe_seen(&ring, cqe); |
| 776 | } |
| 777 | io_uring_queue_exit(&ring); |
| 778 | return 0; |
| 779 | } |
| 780 | |
| 781 | static int run_basic_tests(void) |
| 782 | { |
no test coverage detected