On 11/8/22 4:53 PM, Dylan Yudaken wrote:
+ ret = io_uring_register_files(&ring, &fds[0], 2); + + sqe = io_uring_get_sqe(&ring); + io_uring_prep_read(sqe, 0, &buff, 1, 0); + sqe->flags |= IOSQE_FIXED_FILE; + ret = io_uring_submit(&ring); + if (ret != 1) { + fprintf(stderr, "bad submit\n"); + return 1; + }
This assignment is meaningless: ret = io_uring_register_files(). It's overwritten by ret = io_uring_submit() anyway. I suppose we should have an error handler right after register_files(). -- Ammar Faizi