From: Andy Lutomirski <luto@kernel.org>
To: Joe Perches <joe@perches.com>, akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Andy Whitcroft <apw@canonical.com>,
"Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
Andy Lutomirski <luto@amacapital.net>
Subject: [PATCH v2] errno.h: Improve ENOSYS's comment
Date: Fri, 10 Apr 2015 15:55:53 -0700 [thread overview]
Message-ID: <163f35f8653c46cea9c51410a07cb6cd183bfd58.1428706456.git.luto@kernel.org> (raw)
From: Andy Lutomirski <luto@amacapital.net>
ENOSYS is the mechanism used by user code to detect whether the
running kernel implements a given system call. It should not be
returned by anything except an unimplemented system call.
Unfortunately, it is rather frequently used in the kernel to
indicate that various new functions of existing system calls are not
implemented. This should be discouraged.
Improve the comment in errno.h to help clarify ENOSYS's purpose.
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
---
Changes from v1:
- Fix changelog typo.
- Further improve the comment.
include/uapi/asm-generic/errno.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h
index 1e1ea6e6e7a5..88e0914cf2d9 100644
--- a/include/uapi/asm-generic/errno.h
+++ b/include/uapi/asm-generic/errno.h
@@ -6,7 +6,16 @@
#define EDEADLK 35 /* Resource deadlock would occur */
#define ENAMETOOLONG 36 /* File name too long */
#define ENOLCK 37 /* No record locks available */
-#define ENOSYS 38 /* Function not implemented */
+
+/*
+ * This error code is special: arch syscall entry code will return
+ * -ENOSYS if users try to call a syscall that doesn't exist. To keep
+ * failures of syscalls that really do exist distinguishable from
+ * failures due to attempts to use a nonexistent syscall, syscall
+ * implementations should refrain from returning -ENOSYS.
+ */
+#define ENOSYS 38 /* Invalid system call number */
+
#define ENOTEMPTY 39 /* Directory not empty */
#define ELOOP 40 /* Too many symbolic links encountered */
#define EWOULDBLOCK EAGAIN /* Operation would block */
--
2.3.0
reply other threads:[~2015-04-10 22:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=163f35f8653c46cea9c51410a07cb6cd183bfd58.1428706456.git.luto@kernel.org \
--to=luto@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=arnd@arndb.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mtk.manpages@gmail.com \
/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
all inboxes | Powered by JetHome®