Re: LANANA: To Pending Device Number Registrants

Chip Salzenberg
2001-05-15T23:41:02Z

According to Alan Cox:
> Chip:
> > Wouldn't it be better just to *try* ioctls and see which ones work and
> > which ones don't?
>
> 1. We have overlaps

We all agree that overlaps need to be eliminated over time. In the
meantime, as a coping strategy: I'll bet you that for any two given
device classes, there is at least one ioctl that works on only one of
them. (I'm only talking about an interim workaround! Calm down! Put
down those bats!)

> 2. I've seen code where people play clever ioctl tricks to deduce a
> device type and it ends up looking like one of those chemistry
> identification charts (hopefully minus do you see smoke ?)

I don't mean to suggest that ioctls be used to deduce device types
(except in the case of overlapping ioctl numbers, which shouldn't be
all *that* common (I hope)). I mean to suggest that the question
"What device type are you?" usually shouldn't even be asked!

If you want to do X to the device on fd, just call ioctl(fd, X, ...).
Either it works or it doesn't.

I realize that overlapping ioctls throw a monkey wrench into this
world view. Is it a bigger wrench than the wrenching pain that we'll
have to live through to make device identification reliable? Depends
on how many ioctls overlap, and how easily we could make them stop
overlapping.
--
Chip Salzenberg - a.k.a. - <chip@valinux.com>
"We have no fuel on board, plus or minus 8 kilograms." -- NEAR tech