linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mickaël Salaün" <mic@digikod.net>
To: "Alejandro Colomar" <alx.manpages@gmail.com>,
	"Günther Noack" <gnoack3000@gmail.com>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH v6 1/1] landlock.7: Explain the best-effort fallback mechanism in the example
Date: Tue, 18 Apr 2023 22:50:27 +0200	[thread overview]
Message-ID: <1f68915c-daf6-83ba-3358-e090fca34909@digikod.net> (raw)
In-Reply-To: <da83fef9-5275-f149-6cf7-988220ae0b27@gmail.com>


On 18/04/2023 16:37, Alejandro Colomar wrote:
> 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, ENOTSUPP is a kernel error type, only EOPNOTSUPP should be used 
to return error to user space. ENOTSUPP is not used by the kernel, it is 
only defined by the libc:

# ifndef ENOTSUP
#  define ENOTSUP		EOPNOTSUPP
# endif


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

ENOTSUP doesn't exist in the kernel source, so it is legitimate that 
Landlock and any other kernel interfaces use EOPNOTSUPP.  ENOTSUP should 
then not replace EOPNOTSUPP for Landlock nor any other kernel interfaces.

  reply	other threads:[~2023-04-18 20:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 15:59 [PATCH v6 0/1] landlock.7: Explain best-effort fallback in example Günther Noack
2023-04-14 15:59 ` [PATCH v6 1/1] landlock.7: Explain the best-effort fallback mechanism in the example Günther Noack
2023-04-14 16:35   ` Alejandro Colomar
2023-04-15  7:16     ` Günther Noack
2023-04-17 17:24       ` Alejandro Colomar
2023-04-17 20:54         ` Mickaël Salaün
2023-04-18 14:37           ` Alejandro Colomar
2023-04-18 20:50             ` Mickaël Salaün [this message]
2023-04-18 20:54               ` Alejandro Colomar
2023-04-18 20:55                 ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f68915c-daf6-83ba-3358-e090fca34909@digikod.net \
    --to=mic@digikod.net \
    --cc=alx.manpages@gmail.com \
    --cc=gnoack3000@gmail.com \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).