Skip to contentSkip to conversation

no ioctls for serial ports? [was Re: LANANA: To Pending DeviceNumberRegistrants]

DISCUSSION [email protected] 3 participants 3 messages May 20, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 2 lines

Getting a list of all ioctls in the tree, along with types of their arguments would be a great start. Anyone willing to help with that?

% man 2 ioctl_list

gives a very outdated list. Collecting the present list is trivial but time-consuming. If anyone does I would be happy if he also sent me an updated ioctl_list.2

Andries

[PS I released man-pages-1.36 a few days ago]

#1 lore raw
Quoted 8 lines · On Sun, 20 May 2001 [email protected] wrote:
Quoted 2 lines

Getting a list of all ioctls in the tree, along with types of their arguments would be a great start. Anyone willing to help with that?

% man 2 ioctl_list

gives a very outdated list. Collecting the present list is trivial but time-consuming. If anyone does I would be happy if he also sent me an updated ioctl_list.2

Andries, I wouldn't call it trivial. Consider the following:

                default:
                        if ((cmd & ~(_IOC_SIZEMASK << _IOC_SIZESHIFT)) == JSIOCGNAME(0)) {
                                int len;
                                if (!dev->name) return 0;
                                len = strlen(dev->name) + 1;
                                if (len > _IOC_SIZE(cmd)) len = _IOC_SIZE(cmd);
                                if (copy_to_user((char *) arg, dev->name, len)) return -EFAULT;
                                return len;
                        }

Real-world example. From drivers/input/joydev.c::joydev_ioctl(). And it's far from the worst ones - just one I'm currently looking at.

We have ~180 first-order ioctl() methods. Several (my guess would be 8--15) subsystems of the second order and hell knows how many instances in each of them. And I'm afraid that we have some third-order families. Each instance of each family got some ioctls in it. I think that we have several thousands of these beasts. And that's several thousands of undocumented system calls hidden in bowels of sys_ioctl(). Undocumented == for most of them we have no information of argument types, which arguments are in-, out- or in-out, which contain pointers to other userland structures, etc.

#2 lore raw

Alexander Viro <[email protected]> writes:

[...]

Quoted 1 line

We have ~180 first-order ioctl() methods. Several (my guess would be

Hehe. I suppose you already know about the way strace (@sourceforge) kind of automatically tries to figure out the args for the common ones?

[...]

Signature · 1 line
	http://ape.n3.net