Re: [PATCH v6 1/1] landlock.7: Explain the best-effort fallback mechanism in the example

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mickaël,

On 4/17/23 22:54, Mickaël Salaün wrote:
>>>> BTW, now I checked that while in Linux ENOTSUP and EOPNOTSUPP are
>>>> equivalent, in POSIX the latter has a connotation that it's about
> 
> For Linux:
> #define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */
> #define ENOTSUPP	524	/* Operation is not supported */

$ errno 95
EOPNOTSUPP 95 Operation not supported
$ errno 524
$ echo $?
1


$ grepc -k ENOTSUP /usr/include/
/usr/include/x86_64-linux-gnu/bits/errno.h:30:#  define ENOTSUP		EOPNOTSUPP
$ grepc -k ENOTSUPP /usr/include/
$ grepc -k EOPNOTSUPP /usr/include/
/usr/include/asm-generic/errno.h:78:#define	EOPNOTSUPP	95	/* Operation not supported on transport endpoint */


Is ENOTSUPP a kernel thing?  User space we doesn't seem to agree with
that :).  I'm on Debian Sid.


Indeed, it seems a kernel thing:

$ man -Kaw ENOTSUPP
/usr/local/man/man1/checkpatch.1


That page is one I wrote extracting info from checkpatch.rst.  It seems
checkpatch.pl warns about use of ENOTSUPP.


> 
> EOPNOTSUPP is not only used for network error, but to identify generic 
> unsupported operations, while ENOTSUPP was initially dedicated to NFS 
> error (but now also slipped to other areas)
> 
>>>> sockets.  Should we document ENOTSUP in landlock_create_ruleset(2)
>>>> instead of EOPNOTSUPP? >>
>>> EOPNOTSUP is also used in Landlock's kernel documentation,
>>> we'd maybe have to update it there as well.
>>> I'll have a look at what is more common.
>>
>> Thanks.  In the man pages I see both often, so maybe we need to fix
>> consistency there too.
> 
> No, ENOTSUP*P* is not used by Landlock.

But should it?  I mean ENOTSUP, not ENOTSUPP.

Cheers,
Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux