thanks for the reply, yes it works as you said. sorry it was my mistake.
the IOVs should be also assigned in the Resource Manager to valid buffers.
but i have another question: is there any means to send IOV messages to QNX Resource Manager and receive also IOV messages as reply from the resource manager? It should be some kind like a devctlv function which is not currenty available of course.
There is not such thing as IOV messages. There are just messages. IOV are just use to define what is the message being send. You can use IOV to send but a single block to receive, it`s all up to you.
There is not devctlv because POSIX doesn`t have one. Note that the resmgr can do a reply using IOV but the receiver can do a single read or devctl.
thanks for the answer and sorry for the false used terms, IOVS are IOVs and messages are messages
i tried the devctlv function and it seems to work quite fine.
on the resource manager side, one can use the resmgr_msgreadv function to read out the request data after setting up the IOVs, and when replying dont forget to set the first IOV of ctp with themsg->o.
The code might look like this:
int io_devctl( resmgr_context_t *ctp, io_devctl_t *msg, struct ocb *ocb)
{
int ret;
iov_t iov[n];
my_reply_t buffer[MY_SIZE];
......
// read the request data
ret = resmgr_msgreadv(ctp, iov, n, sizeof(msg->i));
......
// return the reply data
msg->o.nbytes = MY_SIZE * sizeof(my_reply_t);
SET_IOV(ctp->iov[0], &msg->o, sizeof(msg->o));
SET_IOV(ctp->iov[1], buffer[0], sizeof(my_reply_t));
SET_IOV(ctp->iov[2], buffer[1], sizeof(my_reply_t));
......
// return the reply data and the msg->o
return _RESMGR_NPARTS(MY_SIZE + 1);
}
so hopefully this will be usefull for someone in the future.