Re: [Linux-Threads] Re: newly released clone() based pthreads package

Rakesh Dubey (rakesh@arp.com)
Tue, 23 Jul 1996 18:40:33 -0700


>
> One of the first things they teach programmers is that no matter
> what code you write, you can't hurt the hardware. However, if I run the
> following line of code while the plastic cover is closed on my computer:
>
> void main(void) { ioctl(open("/dev/cdrom",0),0x5309,0); }
>
> which causes my CDROM drive to eject, which is physically
> impossible when the case slider is over it. The kernel reports the
> following:
>
> hdb : tray open or drive not ready
> hdb : tray open or drive not ready
> hdb: packet command error: status=0x51
> hdb: packet command error: error=0x40
> hdb: code: 0x70 key: 0x04 asc: 0xb6 ascq: 0x00
>
> Not exactly the most logical way to report this error, is it?
>

My $0.02:

Well, I think in this case it is you who is causing damage to the
hardware and not the programmer. The code did not do this.

Finally, the error message is not all that bad (I suspect you have an
ATAPI CD-ROM, you can look up the error message). Personally, I prefer
this to a meaningless message that says something like "General
failure". However, you have a point here -- the mode sense error
message could be more friendly (like print the actual error string by
doing a table lookup). I wonder if the SCSI errors get printed the
same way..

-Rakesh