On 05/15/2018 11:16 AM, Anthony PERARD wrote:

+    errno = EOPNOTSUPP;

I think ENOSYS would be better. EOPNOTSUPP seems to be for sockets.


No, EOPNOTSUPP is more general than that and is convention for unimplemented 
API operations elsewhere. ENOSYS is supposed to strictly mean 'system call not 
implemented' but we use it for hypercalls in Xen, leading to occasional fun 
with Linux checkpatch.pl.

In man errno, I have:
ENOTSUP         Operation not supported (POSIX.1-2001)
EOPNOTSUPP      Operation not supported on socket (POSIX.1-2001).

POSIX allows (and Linux exploits) ENOTSUP and EOPNOTSUPP to be synonyms for the same error value. I somewhat prefer the ENOTSUP spelling; and it's probably a bit nicer between the two when porting to platforms where the two spellings are not synonyms.

ENOSYS          Function not implemented (POSIX.1-2001).

But I guess any of these would work.


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to