lkml.org 
[lkml]   [2017]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 04/13] xen/pvcalls: implement socket command and handle events
Date
On 10/19/2017 09:26 PM, Stefano Stabellini wrote:
> On Tue, 17 Oct 2017, Boris Ostrovsky wrote:
>> On 10/06/2017 08:30 PM, Stefano Stabellini wrote:

>> with one question:
>>
>>> + /*
>>> + * PVCalls only supports domain AF_INET,
>>> + * type SOCK_STREAM and protocol 0 sockets for now.
>>> + *
>>> + * Check socket type here, AF_INET and protocol checks are done
>>> + * by the caller.
>>> + */
>>> + if (sock->type != SOCK_STREAM)
>>> + return -ENOTSUPP;
>>> +
>>
>>
>> Is this ENOTSUPP or EOPNOTSUPP? I didn't know the former even existed
>> and include/linux/errno.h suggests that this is NFSv3-specific.
>
> The PVCalls spec says that unimplemented commands return ENOTSUPP,
> defined as -524. I guess that is why I used ENOTSUPP, but, actually,
> this is the return value to the caller, which has nothing to do with the
> PVCalls protocol return value. In fact, it could be something entirely
> different.
>
> In this case, I think you are correct, it is best to use EOPNOTSUPP.
> I'll make the change and retain your Reviewed-by, if that's OK for you.
>

Of course.

This all is somewhat convoluted:

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.)

/usr/include/bits/errno.h:
/* Linux has no ENOTSUP error code. */
# define ENOTSUP EOPNOTSUPP


Linux kernel:
include/linux/errno.h:
/* Defined for the NFSv3 protocol */
...
#define ENOTSUPP 524 /* Operation is not supported */


include/uapi/asm-generic/errno.h:
#define EOPNOTSUPP 95 /* Operation not supported on transport
endpoint */


ENOTSUP is not generally defined in Linux kernel.


Clear as mud.


-boris

\
 
 \ /
  Last update: 2017-10-22 17:41    [W:0.063 / U:36.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site