lkml.org 
[lkml]   [1999]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: accessing media_changed() for CDROMs
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/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.049 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site