Re: LANANA: To Pending Device Number Registrants

Chip Salzenberg (chip@valinux.com)
Tue, 15 May 2001 16:39:23 -0700


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
-
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/