public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Ioctl CDROMRESET has no effect
@ 2001-02-07 16:34 Paul Powell
  2001-02-07 16:40 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Powell @ 2001-02-07 16:34 UTC (permalink / raw)
  To: linux-kernel

I'm attempting to reset a CDROM using the CDROMRESET
ioctl.  The reset command only seems to reset the
device if the device is not mounted.  If the device is
mounted, the reset command seems to have no effect.

With the device unmounted, sending the reset command
causes the drive to become active and I see the
activity light light up.  With the device mounted, the
activity light does nothing.  I also can't open the
CD-ROM drive using the eject button after resetting a
mounted CD.

It seems the reset command should work even if the OS
thinks the device is mounted for error recovery.

Here is my test program:

#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/cdrom.h>

int main(int argc, char* argv[])
{
   int fd, result;

   fd = open("/dev/hda", O_RDONLY|O_NONBLOCK);
   if (fd < 0)
   {
      perror("open");
      return fd;
   }   
   
   result = ioctl(fd, CDROMRESET, 1);
   if (result < 0)
      perror("ioctl");
  
   close(fd);
   return 0;
}

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-02-07 16:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-07 16:34 Ioctl CDROMRESET has no effect Paul Powell
2001-02-07 16:40 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox