linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: nforro@redhat.com
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org
Subject: Re: [PATCH] mmap.2: fix EINVAL conditions
Date: Fri, 13 Sep 2019 16:26:56 +0200	[thread overview]
Message-ID: <6043e06f-011e-ef75-cd9b-b0a0b3cee5a8@gmail.com> (raw)
In-Reply-To: <ba87bced44ac346f45887c6e91d0d29b0632a7f9.camel@redhat.com>

Hello Nikola,

On 6/24/19 1:20 PM, Nikola Forró wrote:
> Since introduction of MAP_SHARED_VALIDATE, in case flags contain
> both MAP_PRIVATE and MAP_SHARED, mmap() doesn't fail with EINVAL,
> it succeeds.
> 
> The reason for that is that MAP_SHARED_VALIDATE is in fact equal
> to MAP_PRIVATE | MAP_SHARED.
> 
> This is intended behavior, see:
> https://lwn.net/Articles/758594/
> https://lwn.net/Articles/758598/

Patch applied. Thanks for the excellent detail in covering
message.

Cheers,

Michael

> 
> Signed-off-by: Nikola Forró <nforro@redhat.com>
> ---
>  man2/mmap.2 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/man2/mmap.2 b/man2/mmap.2
> index cea0bd372..b41e8b9ca 100644
> --- a/man2/mmap.2
> +++ b/man2/mmap.2
> @@ -565,11 +565,11 @@ was 0.
>  .TP
>  .B EINVAL
>  .I flags
> -contained neither
> -.B MAP_PRIVATE
> +contained none of
> +.BR MAP_PRIVATE ,
> +.B MAP_SHARED
>  or
> -.BR MAP_SHARED ,
> -or contained both of these values.
> +.BR MAP_SHARED_VALIDATE .
>  .TP
>  .B ENFILE
>  .\" This is for shared anonymous segments
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

           reply	other threads:[~2019-09-13 14:27 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <ba87bced44ac346f45887c6e91d0d29b0632a7f9.camel@redhat.com>]

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=6043e06f-011e-ef75-cd9b-b0a0b3cee5a8@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=nforro@redhat.com \
    /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).