Messages in this thread | | | Date | Wed, 16 May 2001 12:25:59 -0600 | From | Richard Gooch <> | Subject | Re: LANANA: To Pending Device Number Registrants |
| |
Andrzej Krzysztofowicz writes: > > > > OK, just correct me if I get this wrong, but this code is taking the LAST 2 > > characters of the device name and verifying that it is "cd". Which would > > mean that the standard states that "/dev/ginsucd" would be a CD-ROM drive? > > > > That is why I feel a "name" of a device handle shouldnt set how a driver > > operates in this fashion... if you make a small error in your compare, you > > might try to eject a Ginsu Cabbage Dicer instead of a cdrom drive... OOPS! > > > > Sam Bingner > > > > Alan Cox writes: > > > > len = readlink ("/proc/self/3", buffer, buflen); > > > > if (strcmp (buffer + len - 2, "cd") != 0) { > > > > fprintf (stderr, "Not a CD-ROM! Bugger off.\n"); > > > > exit (1); > > > > > > And on my box cd is the cabbage dicer whoops > > > > Actually, no, because it's guaranteed that a trailing "/cd" is a > > CD-ROM. That's the standard. > > Sure, you no longer support /dev/sdcd (eighty-second SCSI disk)...
Then you haven't looked at what devfs actually does. *All* CD-ROMs will have a trailing pathname component of "/cd". In other words, the name of the leaf node in it's parent directory is "cd". The FAQ describes this.
Regards,
Richard.... Permanent: rgooch@atnf.csiro.au Current: rgooch@ras.ucalgary.ca - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |