Re: accessing media_changed() for CDROMs

D.A. Harris (rodmur@ecst.csuchico.edu)
Sat, 6 Feb 1999 14:16:17 -0800


On Sat, Feb 06, 1999 at 01:04:06PM -0800, D.A. Harris wrote:
> 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

ok, I'm being stupid. I was reading an old man page and it had bad
information. Always good to have one of Stevens' books around to reference.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/