shuveb / io_uring-by-example

A companion repository for the io_uring by Example article series
MIT License
372 stars 56 forks source link

Error in example 2? #3

Closed josephcsible closed 4 years ago

josephcsible commented 4 years ago

https://github.com/shuveb/io_uring-by-example/blob/8d069f07e8b00e352f22b54d2751e69678771ce4/02_cat_uring/main.c#L222

fi->iovecs->iov_base looks wrong to me. It's equivalent to fi->iovecs[0].iov_base, but shouldn't it be fi->iovecs[i].iov_base? Won't this corrupt any file longer than 4KB?

shuveb commented 4 years ago

That was very sharp! Thanks for catching that @josephcsible. Fixed and pushed.