| 41 | } |
| 42 | |
| 43 | static int register_memory(struct io_uring *ring, void *ptr, size_t size) |
| 44 | { |
| 45 | struct io_uring_region_desc rd = {}; |
| 46 | struct io_uring_mem_region_reg mr = {}; |
| 47 | |
| 48 | rd.user_addr = uring_ptr_to_u64(ptr); |
| 49 | rd.size = size; |
| 50 | rd.flags = IORING_MEM_REGION_TYPE_USER; |
| 51 | mr.region_uptr = uring_ptr_to_u64(&rd); |
| 52 | mr.flags = IORING_MEM_REGION_REG_WAIT_ARG; |
| 53 | |
| 54 | return io_uring_register_region(ring, &mr); |
| 55 | } |
| 56 | |
| 57 | int main(int argc, char *argv[]) |
| 58 | { |
no test coverage detected