How big size of IOV

Hi,

Does any one know how big is a size of IOV? I got an error (Memory fault (core dumped)) when I tried to return compressed video data buffer (about 150,000 bytes) in io_ctrl() program to a client API program. resource manager was stopped and pop error message. the code as following.
int io_devctl (resmgr_context_t *ctp, io_devctl_t *msg, RESMGR_OCB_T *ocb)
{
int sts;
int32_t nbytes;
int dcmd;
void *data;
dcmd_video_data_t *video_arg;
data = _DEVCTL_DATA(msg->i);
dcmd = msg → i.dcmd;
len = msg → i.nbytes;
memset (&msg → o, 0, sizeof (msg → o));
// preset the number of bytes that we’ll return to zero
nbytes = 0;
sts = EIO;
ret = -1;
switch (dcmd) {
case DCMD_INIT_CTR1472 :

case DCMD_GET_VIDEO_DATA :
{
video_arg = (dcmd_video_data_t *) data;
vret = ctr1472_obj->ReadVideoBytes(&channels, (uint8_t ) video_arg- >buffer); /// the video_arg->buffer size is 200000
if (vret > 0) {
video_arg->length = vret;
video_arg->channel = channels;
nbytes = sizeof (dcmd_video_data_t);
sts = EOK;
}
else {
if (optv) printf(“DCMD_GET_AUDIO_DATA aret invalid\n”);
nbytes = sizeof (int);
}
break;
default:
return(ENOSYS);
}
/

If you wanted to pass something different to the return
field of the devctl() you could do it through this member.
/
msg->o.ret_val = sts;
/
Indicate the number of bytes and return the message */
msg->o.nbytes = nbytes;
SETIOV (ctp->iov, &msg->o, sizeof (msg->o) + nbytes);
return (_RESMGR_NPARTS (1));
}

I dimly remember that the size of the data structure passed with devctl() is limited to 16K, because the upper 2 bits are used for the direction indication. Look up help for devctl(), and the __DIOTF() macros.

Regards,
Albrecht

Thanks. you are right that it must be less than 16K bytes according to __DIO*().
However, I am wondering if I want to transfer the data size bigger than 16K, what I have to do. If use read(fd, buffer, size), can the buffer be bigger than 16K? Also I still don’t get the point how the function
int io_read (resmgr_context_t *ctp, io_read_t *msg, RESMGR_OCB_T *ocb) in server side can convey data to a buffer which was provided by client side call function read(fd, buffer, size). They are in 2 different processes. I saw same sample code that uses ocb to achieve it. but I don’t know how. Do you have any idea about the mechanism of buffer or pointer to convey the data?