lkml.org 
[lkml]   [2014]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] checkpatch.pl: New instances of ENOSYS are errors
On Aug 25, 2014 3:29 AM, "Pavel Machek" <pavel@ucw.cz> wrote:
>
> On Fri 2014-08-22 09:26:31, Andy Lutomirski wrote:
> > ENOSYS means that a nonexistent system call was called. We have a
> > bad habit of using it for things like invalid operations on
> > otherwise valid syscalls. We should avoid this in new code.
>
> Is it good idea? I mean, doing EINVAL for subcalls is pretty
> unhelpful.

EOPNOTSUPP?

The problem is that user code wants to do:

bool foo_wrapper(int op)
{
if (foo_not_supported)
return false

if (foo(op) != 0) {
if (errno == ENOSYS)
foo_not_supported = true;
return false;
}

return true;
}

foo_wrapper(FOO_OP_A);
foo_wrapper(FOO_OP_B);

If FOO_OP_A returns -ENOSYS but FOO_OP_B does not, then this doesn't work.

--Andy


\
 
 \ /
  Last update: 2014-08-25 21:01    [W:0.040 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site