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

Function main

test/fpos.c:225–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225int main(int argc, char *argv[])
226{
227 struct io_uring ring;
228 int ret;
229
230 if (argc > 1)
231 return T_EXIT_SKIP;
232
233 ret = io_uring_queue_init(QUEUE_SIZE, &ring, 0);
234 if (ret) {
235 fprintf(stderr, "ring setup failed\n");
236 return T_EXIT_FAIL;
237 }
238
239 for (int test = 0; test < 8; test++) {
240 int async = test & 0x01;
241 int write = test & 0x02;
242 int blocksize = test & 0x04 ? 1 : 7;
243
244 ret = write
245 ? test_write(&ring, !!async, blocksize)
246 : test_read(&ring, !!async, blocksize);
247 if (ret) {
248 fprintf(stderr, "failed %s async=%d blocksize=%d\n",
249 write ? "write" : "read",
250 async, blocksize);
251 return -1;
252 }
253 }
254 return T_EXIT_PASS;
255}

Callers

nothing calls this directly

Calls 3

io_uring_queue_initFunction · 0.85
test_writeFunction · 0.85
test_readFunction · 0.85

Tested by

no test coverage detected