Re[2]: cdrom ioctls
Esmont Alexander <[email protected]>
| Newsgroups | gmane.linux.enbd.general |
|---|---|
| Organization | Best Way |
| Message-ID | <[email protected]> |
Hello Peter,
>> I have one problem with netblock - some cdrom ioctls have not right
>> processing. For example: CDROM_DRIVE_STATUS and CDROM_DISK_STATUS must
>> return drive and disk status accordingly, but return 0 always.
>>
>> Please, prompt me what and where change to correct working of that
>> ioctls?
PTB> You need to read the enbd_ioctl_table.h file (2.6 kernel).
PTB> { CDROM_DRIVE_STATUS, _NEW_IOW(CDROM_DRIVE_STATUS, int), },
PTB> { CDROM_DISC_STATUS, _NEW_IO(CDROM_DISC_STATUS), },
PTB> Which says that the first is a write of an int-sized datum to the
PTB> kernel (such ioctls can only return success or failure, 0 or -ve value),
PTB> and the second is a call that neither expects an argument nor returns a
PTB> result (it will be 0 or -ve for error).
Change _NEW_IOW to _NEW_IOR nothing change in result.
PTB> Is that not the case? In that casechange and tell me about it.
This ioctls in direct call return status as result of ioctl function,
but not as arg. In this case by network need to transmit result of
res = ioctl( export, nioctl, arg); // file.c, 1191
i.e. result of this ioctls is a value of 'res' variable.
And for user aplication this value must be result of his ioctl() to
netblock device (/dev/nda).
I'm not sure that i can made necessary changes.
Please, help me.
--
С наилучшими пожеланиями, ICQ:111941352
Александр пишите: [email protected]