lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 25 Aug 2014 11:38:28 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Pavel Machek <pavel@....cz>
Cc:	Joe Perches <joe@...ches.com>, Andy Whitcroft <apw@...onical.com>,
	Michael Kerrisk <mtk.manpages@...il.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] checkpatch.pl: New instances of ENOSYS are errors

On Aug 25, 2014 3:29 AM, "Pavel Machek" <pavel@....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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ