Re: accessing media_changed() for CDROMs

D.A. Harris (rodmur@ecst.csuchico.edu)
Sat, 6 Feb 1999 13:04:06 -0800


On Thu, Feb 04, 1999 at 10:46:11PM +0100, Jens Axboe wrote:
>
> The correct way to use the ioctl, would be something like this :
>
> changed = ioctl(drive, CDROM_MEDIA_CHANGED, CDSL_CURRENT);
>
> And that is the only way you can do it. There's no way you can retrieve
> the info by trying to call media_changed() - userspace programs can't
> access kernelspace functions like that. Hey, that's one of the reasons
> for ioctl!
>

Ok. Thanks for the help. Course how is changed going to be anything other
than 0? ioctl only returns 0 if ok or -1 on error. So it doesn't
appear that would work. No information on wether the CD was changed will
be returned. The third argument is ioctl() by convention char*, and as far
as I can tell the only way to get any information from the kernel. So it
would still appear that I need acces to the Uniform cdrom data structures
defined in <linux/cdrom.h> which are only available if I #define __KERNEL__

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dale Harris  <rodmur@csuchico.edu>   http://www.ecst.csuchico.edu/~rodmur/
GPG-Fingerprint: 8849 BC4F 3DF0 F0A8 3355  E94C 537C 3E1D EEE5 2AB2
|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|+|

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/