MCPcopy Create free account
hub / github.com/axboe/liburing / test_remove

Function test_remove

test/epwait.c:162–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162static int test_remove(struct io_uring *ring, int efd)
163{
164 struct io_uring_sqe *sqe;
165 struct io_uring_cqe *cqe;
166 struct epoll_event out[2];
167 int i, ret;
168
169 memset(out, 0, sizeof(out));
170 sqe = io_uring_get_sqe(ring);
171 io_uring_prep_epoll_wait(sqe, efd, out, 2, 0);
172 sqe->user_data = 1;
173 io_uring_submit(ring);
174
175 close(efd);
176
177 usleep(10000);
178 for (i = 0; i < 2; i++) {
179 ret = write(fds[i][1], "foo", 3);
180 if (ret < 0)
181 perror("write");
182 }
183
184 for (i = 0; i < 1; i++) {
185 ret = io_uring_peek_cqe(ring, &cqe);
186 if (ret == -EAGAIN) {
187 break;
188 } else if (ret) {
189 fprintf(stderr, "wait_cqe ret = %d\n", ret);
190 break;
191 }
192 io_uring_cqe_seen(ring, cqe);
193 }
194
195 return 0;
196}
197
198#define NPIPES 8
199#define MAX_QE 1000

Callers 1

testFunction · 0.85

Calls 2

io_uring_submitFunction · 0.85
io_uring_get_sqeFunction · 0.50

Tested by

no test coverage detected