Subject: Re: IOCTL implementation and kernel/userland addresses
To: Reinoud Zandijk <reinoud@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 02/16/2005 18:14:54
FKIOCTL should not be added to FMASK or FCNTLFLAGS,
since those both contain only flags which user processes can use.

-Chuck


On Wed, Feb 16, 2005 at 11:25:39PM +0100, Reinoud Zandijk wrote:
> On Mon, Feb 14, 2005 at 10:43:49AM -0800, Bill Studenmund wrote:
> > > > Maybe "FKADDR".
> > > 
> > > in solaris it's called FKIOCTL, how about we use that?
> 
> What about this following patch:
> 
> > cvs -q diff -u sys/fcntl.h
> Index: sys/fcntl.h
> ===================================================================
> RCS file: /cvsroot/src/sys/sys/fcntl.h,v
> retrieving revision 1.29
> diff -u -r1.29 fcntl.h
> --- sys/fcntl.h 3 Feb 2005 19:20:01 -0000       1.29
> +++ sys/fcntl.h 16 Feb 2005 22:21:31 -0000
> @@ -124,11 +124,12 @@
>  #define        FMARK           0x00001000      /* mark during gc() */
>  #define        FDEFER          0x00002000      /* defer for next gc pass */
>  #define        FHASLOCK        0x00004000      /* descriptor holds advisory lock */
> +#define FKIOCTL                0x80000000
>  /* bits to save after open(2) */
>  #define        FMASK           
> (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|\
> -                        FRSYNC|FALTIO)
> +                        FRSYNC|FALTIO|FKIOCTL)
>  /* bits settable by fcntl(F_SETFL, ...) */
> -#define        FCNTLFLAGS      
> (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|FRSYNC|FALTIO)
> +#define        FCNTLFLAGS      
> (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FDSYNC|FRSYNC|FALTIO|FKIOCTL)
>  #endif /* _KERNEL */
>  
>  /*
>