QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Reply from qnx_ioctl() |
Ref. No. |
QNX.000009235 |
Category(ies) |
Development |
Issue |
A client is making the call qnx_ioctl ( fd , request , NULL , 0 , &qioctl_reply , sizeof ( qioctl_reply )) and the io manager is replying with sizeof(qioctl_reply) - sizeof(qioctl_reply.data) bytes. The client's buffer returns untouched. Is there a minimum number of bytes that must be replied with before qnx_ioctl() will stuff them into the reply buffer? This mechanism works when the io manager replies with sizeof(qioctl_reply) + 50 bytes, but not when it replies with 4 bytes. |
Solution |
This makes sense. The io manager must reply with at least sizeof(struct _io_qioctl_reply) before any data will go into the client's buffer. Since the size of that structure is 13 bytes (including 1 token data byte) a 4-byte reply not only contains no data, it is invalid. The absolute minimum "legal" reply is 12 bytes if there is no data.
Actually, your statement "is replying with sizeof ( qioctl_reply ) - sizeof(qioctl_reply.data) bytes" implies that it is replying with the 12-byte reply header. There is still no data, so nothing will go into the client's reply buffer, but since you didn't show how you defined 'qioctl_reply' I'm just guessing. |
|