MsgWritev() explanation request

Hi,

I am trying to write the message passing functions using SystemC as a part of my Thesis project in Concordia University. Therefore, I was looking at the QNX website, and particularly at the implementation of the MsgWritev(). Here is a picture attached of what I have in mind about the way message passing is done in QNX.

I’d like to have more details, if possible, about how this function is implemented and know more about how the “offset” is interpreted:
is it considered to be given in bytes or as an index in the sender buffer (ex. start writing to sender_iov[1] if offset is 1)?

Also, knowing that the iov buffer in MsgWritev() should be written to the sender buffer: sender_iov[] at a certain offset, what if the length of sender buffer[index] (sender_iov[i].iov_len) is less than or greater than the length of the iov buffer[index] (iov[i].iov_len)? Should we allow this to happen?

Thank you

The doc says: “An offset into the sender’s buffer that indicates where you want to start writing the data.” The sender’s buffer is defined by the parameters specify in the MsgSend*(), the offset are in bytes.

The doc about the size argument of MsgWrite also says:
The number of bytes that you want to write. These functions don’t let you write past the end of the sender’s buffer; they return the number of bytes actually written.