Changes in examples/io_uring.c [f100a83:3a3b2b9]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/io_uring.c
rf100a83 r3a3b2b9 33 33 io_uring_prep_readv(sqe, fd, &iov, 1, 0); 34 34 35 sqe->user_data = data;36 37 35 /* tell the kernel we have an sqe ready for consumption */ 38 36 io_uring_submit(&ring); … … 40 38 /* wait for the sqe to complete */ 41 39 int ret = io_uring_wait_cqe(&ring, &cqe); 42 40 printf("%d\n", ret); 41 43 42 /* read and process cqe event */ 44 if(ret == 0) { 45 char * out = cqe->user_data; 46 signed int len = cqe->res; 47 io_uring_cqe_seen(&ring, cqe); 48 49 if(len > 0) { 50 printf("%.*s", len, out); 51 } 52 } 53 else { 54 printf("%d\n", ret); 55 io_uring_cqe_seen(&ring, cqe); 56 } 43 printf("%s", data); 44 io_uring_cqe_seen(&ring, cqe); 57 45 58 46 io_uring_queue_exit(&ring);
Note: See TracChangeset
for help on using the changeset viewer.