lkml.org 
[lkml]   [2015]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Question] Usage of ENOTSUPP error code
Masahiro Yamada wrote:
> I noticed many drivers return -ENOTSUPP on error.
>
> I assume ENOTSUPP is defined in include/linux/errno.h
> as follows:
>
> /* Defined for the NFSv3 protocol */
> ...
> #define ENOTSUPP 524 /* Operation is not supported */
>
> If so, should ENOTSUPP be only used for NFS-related errors?

There is typcially no such restriction.

However, the problem with ENOTSUPP is that it is not defined in
the uapi header, so it will not be known to user space programs.

> In fact, ENOTSUPP is used by various drivers
> including non-network ones such as pinctrl, USB, etc.

If it is possible that the error code shows up for user space, ENOTSUPP
should not be used. Alternatives would be something like ENOTSUP,
EOPNOTSUPP, ENOIOCTLCMD, ENOSYS, or EINVAL.


Regards,
Clemens


\
 
 \ /
  Last update: 2015-07-06 09:41    [W:0.986 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site