lkml.org 
[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] livepatch: core: Return ENOTSUPP instead of ENOSYS
On Wed, Jan 30, 2019 at 01:41:56PM +0100, Petr Mladek wrote:
> Hmm, the error code is passed to the syscall, for example:
>
> + SYSCALL_DEFINE3(init_module
> + load_module()
> + do_init_module()
> + do_one_initcall(mod->init);
>
> I am not sure if we are allowed to return -ENOTSUPP (-524).
> It is defined in the internal include/linux/errno.h. There
> is the following commnent:
>
> /*
> * These should never be seen by user programs...
>
>
>
> I tried to find a better alternative and found:
>
> #define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
>
>
> There is the following note in man errno:
>
> ENOTSUP Operation not supported (POSIX.1)
>
> EOPNOTSUPP Operation not supported on socket (POSIX.1)
> (ENOTSUP and EOPNOTSUPP have the same value
> on Linux, but according to POSIX.1 these error
> values should be distinct.)
>
> And it looks that -EOPNOTSUPP is used widely in many subsystes (not
> only network).

Yes, you are right. It's confusing that ENOTSUPP and ENOTSUP are not
the same thing. EOPNOTSUPP sounds good.

--
Josh

\
 
 \ /
  Last update: 2019-01-30 14:12    [W:0.043 / U:28.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site