* For users that want to specify sq_thread_cpu or sq_thread_idle, this * interface is a convenient helper for mmap()ing the rings. * Returns -errno on error, or zero on success. On success, 'ring' * contains the necessary information to read/write to the rings. */
| 168 | * contains the necessary information to read/write to the rings. |
| 169 | */ |
| 170 | __cold int io_uring_queue_mmap(int fd, struct io_uring_params *p, |
| 171 | struct io_uring *ring) |
| 172 | { |
| 173 | int ret; |
| 174 | |
| 175 | memset(ring, 0, sizeof(*ring)); |
| 176 | ret = io_uring_mmap(fd, p, &ring->sq, &ring->cq); |
| 177 | if (!ret) { |
| 178 | ring->flags = p->flags; |
| 179 | ring->features = p->features; |
| 180 | ring->ring_fd = ring->enter_ring_fd = fd; |
| 181 | } |
| 182 | return ret; |
| 183 | } |
| 184 | |
| 185 | static size_t io_uring_sqes_size(const struct io_uring *ring) |
| 186 | { |
no test coverage detected