Subject: Re: Keyboard support for DEC3000
To: Chris G. Demetriou <cgd@netbsd1.cygnus.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: port-alpha
Date: 07/24/1998 17:53:06
On 24 Jul 1998 18:04:45 -0700 
 cgd@netbsd1.cygnus.com (Chris G. Demetriou) wrote:

 > "R vs. W don't do what you think they do."
 > 
 > In particular, they have _nothing_ to do with checking permissions
 > (you have to do that yourself with the ioctl flags arg, if you think
 > it's appropriate -- in this case, given the way keyboards are used,
 > i'm not sure that it is), but rather with whether data is to be copied
 > into or out of the kernel on ioctl() entry and exit.
 > 
 > _IO == no data
 > _IOR == kernel reads the data on entry
 > _IOW == kernel writes the data on exit
 > _IOWR == kernel reads on entry then writes on exit.

not according to ioccom.h

IOC_IN == copy parameters in, and _IOW uses IOC_IN.  _IOR uses IOC_OUT.

I think the "read/write" is from the perspective of the requesting process.

Jason R. Thorpe                                       thorpej@nas.nasa.gov
NASA Ames Research Center                            Home: +1 408 866 1912
NAS: M/S 258-5                                       Work: +1 650 604 0935
Moffett Field, CA 94035                             Pager: +1 650 940 5942