Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In this code:

  for (i = 0; i < BUFS_IN_GROUP; i++) {
    /* add each buffer, we'll use i buffer ID */
    io_uring_buf_ring_add(br, bufs[i], BUF_SIZE, i,
            io_uring_buf_ring_mask(BUFS_IN_GROUP), i);
   }
Where did bufs come from? Should that be br.bufs[i]?


The buffers are supplied elsewhere outside that example, just consider it an array of pointers to buffers of size BUF_SIZE. br->bufs[] is the shared space, it holds information on the address/size/id of a given buffer.


I think so, yes. struct io_uring_buf_ring is a union that includes a bufs member:

    struct io_uring_buf    bufs[0];


i think it should be br[i]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: