From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] UBI: block: Use ENOSYS as return value when CONFIG_UBIBLOCK=n
Date: Tue, 4 Mar 2014 09:14:47 -0300 [thread overview]
Message-ID: <20140304121446.GA8826@localhost> (raw)
In-Reply-To: <1393933791.3412.208.camel@sauron.fi.intel.com>
On Tue, Mar 04, 2014 at 01:49:51PM +0200, Artem Bityutskiy wrote:
> On Tue, 2014-03-04 at 07:57 -0300, Ezequiel Garcia wrote:
> > In order to have a way of distinguishing an invalid ioctl from a
> > not supported (but otherwise valid) ioctl, this commit changes the
> > return value of the ioctl stubs from ENOTTY to ENOSYS.
>
> Sounds logical, no objections, except it is curious if this is something
> you invented or this is a general rule in the Linux kernel? If it is,
> may be you can point to some discussions, or give some example or other
> source of this knowledge? I just want to be educated a bit. Thanks!
>
Yes, I think it's a pretty extended kernel practice to return -ENOSYS when
a function is not built or either not implemented.
A good number of headers in include/linux/ use -ENOSYS as the return value
for the !CONFIG_FEATURE stubs.
$ git grep ENOSYS include/linux/ | wc -l
172
And of course, the syscall ABI returns -ENOSYS for unimplemented system calls.
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-03-04 12:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-04 10:57 [PATCH] UBI: block: Use ENOSYS as return value when CONFIG_UBIBLOCK=n Ezequiel Garcia
2014-03-04 11:49 ` Artem Bityutskiy
2014-03-04 12:14 ` Ezequiel Garcia [this message]
2014-03-04 13:00 ` Artem Bityutskiy
2014-03-05 13:30 ` Ezequiel Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140304121446.GA8826@localhost \
--to=ezequiel.garcia@free-electrons.com \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).