Re: [RFC PATCH -tip 1/5] kprobes: Use ENOTSUPP instead of ENOSYS
From: Masami Hiramatsu
Date: Fri Oct 20 2017 - 11:52:03 EST
On Fri, 20 Oct 2017 10:57:22 +0200
Ingo Molnar <mingo@xxxxxxxxxx> wrote:
>
> * Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
>
> > Use ENOTSUPP instead of ENOSYS because ENOSYS is reserved
> > only for invalid syscall number.
>
> Is this actually true? We use -ENOSYS in a ton of code in kernel/ already, not
> just for non-existing syscall number.
I got a warning from checkpatches.pl, also in include/uapi/asm-generic/errno.h,
/*
* 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 */
So, I decided not to use ENOSYS for this error.
Thank you,
>
> Ingo
--
Masami Hiramatsu <mhiramat@xxxxxxxxxx>