-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 19 Nov 2002 20:06, Ian Molton wrote:
> On Mon, 18 Nov 2002 21:30:29 -0800
>
> Greg KH <[EMAIL PROTECTED]> wrote:
> > > partly because of comments on this list about it being better than
> > > just leaving users to do everything through file i/o :-)
> >
> > Hm, no, not a good idea :)
>
> why do people hate IOCTLs ?
Different people hate them for different reasons. There is a lot to hate :)

1. Some people don't like the lack of portability. 

2. Lots of people worry about the way the security aspects. The Stanford 
checker is still finding bugs.

3. Architects worry about the ad-hoc nature. Basically, you can just shove an 
ioctl() in anywhere, and blow off a proper API. This is the probably the 
biggest issue, and you can do _decent_ design with ioctl()s. (You can write 
maintainable code in assembler too, however both are pretty rare)

4. Some people don't like the unstructured nature. It is often next to 
impossible to tell how you are meant to use the beast, unless you have an 
example.

5. The documentation is always terrible.

Here is an example, from <linux/input.h>,(not because it is particularly bad, 
but just because I'm familiar with it):
#define EVIOCGREP               _IOR('E', 0x03, int[2]) 

What do you think that does?

Now if you had the comment:
/* get repeat settings */
(which is in the header), do you have any more idea?

How about this one:
#define EVIOCGSND(len)          _IOC(_IOC_READ, 'E', 0x1a, len)         /* get 
all sounds status */

Does that make the problem any clearer?

To be fair to the OP, Greg suggested using usbfs/libusb. That is really only 
swapping one set of ioctl()s for another. However at least they are a fairly 
well designed set of ioctl()s, and if you use libusb, you are probably 
insulated from API changes in the kernel.

- -- 
http://linux.conf.au. 22-25Jan2003. Perth, Aust. I'm registered. Are you?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE92gvzW6pHgIdAuOMRAuTVAKCaBCLXXFc1zHsr1IjmjwPeklbyEQCeJS0k
TDP2AYHdbMzsFY5Wi4JSXDI=
=b/zR
-----END PGP SIGNATURE-----



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to