public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Asynchronous CDROM Events in Userland
Date: 3 Feb 2002 21:07:24 -0800	[thread overview]
Message-ID: <a3l4uc$laf$1@cesium.transmeta.com> (raw)
In-Reply-To: <Pine.LNX.4.30.0202032333200.1158-100000@rtlab.med.cornell.edu>

Followup to:  <Pine.LNX.4.30.0202032333200.1158-100000@rtlab.med.cornell.edu>
By author:    "Calin A. Culianu" <calin@ajvar.org>
In newsgroup: linux.dev.kernel
>
> 
> Is there any way, other than by polling, to have a user process be
> notified of a change in status on a cdrom drive?  (Such as if the drive
> opens, closes, gets new media, etc)?
> 
> Also, come think of it, other types of asynchronous events would be nice
> too, like when a cdrom usb device gets hot-plugged into the system, etc.
> 
> The current ioctls are inadequate for this type of thing (they are
> synchronous in nature). One nice thing would be if we can register SIGUSR
> or other types of signals with the cdrom driver(s) so that it can notify a
> user process of (cdrom) events it may be interested in.
> 
> The reason I ask this is that the current autorun program that comes with
> kde is very inefficient because it polls the cdrom drives.  Also, this
> program is completely unable to determine that a usb device has come
> online, because it basically can't differentiate between bogus /etc/fstab
> entries and offline usb devices.
> 
> At any rate, if anyone can suggest a way to asynchronously receive cdrom
> events in userland, it would be appreciated.
> 
> If not what do you guys think about extensions to the cdrom drivers to
> handle these types of things?
> 

Rather than a signal, it should be a file descriptor of some sort, so
one can select() etc on it.  Personally I can't imagine polling would
take any appreciable amount of resources, though.

A more important issue is probably to get notification when the eject
button is pushed and the device is locked, so that it can try to
umount and eject it, unless busy.

	-hpa


-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

  reply	other threads:[~2002-02-04  5:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-04  4:41 Asynchronous CDROM Events in Userland Calin A. Culianu
2002-02-04  5:07 ` H. Peter Anvin [this message]
2002-02-04  5:19   ` Calin A. Culianu
2002-02-04 12:43   ` john slee
2002-02-04 15:23     ` Calin A. Culianu
2002-02-04 16:20     ` H. Peter Anvin
2002-02-04  7:04 ` Erik Andersen
2002-02-04  7:57   ` Jens Axboe
2002-02-04  9:33     ` Gregor Jasny
2002-02-04  9:39       ` Jens Axboe
2002-02-04 14:05     ` hugang
2002-02-05  7:43       ` Jens Axboe
2002-02-04 12:16   ` Alan Cox
2002-02-04 20:51     ` oops booting 2.4.18-pre7-ac3 Todd M. Roy
2002-02-05  4:04 ` Asynchronous CDROM Events in Userland Stevie O
2002-02-05  4:28   ` H. Peter Anvin
2002-02-05  4:44     ` Calin A. Culianu
2002-02-05  4:47       ` H. Peter Anvin
     [not found] ` <a3l4uc@cesium.transmeta.com>
2002-02-06 14:22   ` Pavel Machek
2002-02-06 22:48     ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2002-02-05 13:17 David Balazic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='a3l4uc$laf$1@cesium.transmeta.com' \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox