lkml.org 
[lkml]   [2009]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 6/7] um: Convert mmapper to unlocked_ioctl
On Thu, 15 Oct 2009, Arnd Bergmann wrote:

> On Thursday 15 October 2009, Thomas Gleixner wrote:
> > The ioctl is empty and needs no serialization. We might remove it
> > completely but that would change the return value from -ENOIOCTLCMD to
> > -ENOTTY.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Jeff Dike <jdike@addtoit.com>
>
> This one is tricky if you want to get it right according to the
> book. ENOIOCTLCMD is never a valid return code for user space,
> but sys_ioctl passes it down anyway.
>
> However, returning -ENOIOCTLCMD from an *unlocked_ioctl* function
> automatically gets turned into -EINVAL. It does this to allow
> the same functions to be used for unlocked_ioctl and compat_ioctl.
> In effect, this patch is functionally identical to removing the
> ioctl function, which I think is what should be done here.

Yeah, we get either -ENOTTY or -EINVAL which always changes the user
space return value. So yes, removing it at least saves some line of
code :)

Thanks,

tglx


\
 
 \ /
  Last update: 2009-10-15 17:07    [W:0.083 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site