Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH] mmap.2: fix EINVAL conditions
       [not found] <ba87bced44ac346f45887c6e91d0d29b0632a7f9.camel@redhat.com>
@ 2019-09-13 14:26 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; only message in thread
From: Michael Kerrisk (man-pages) @ 2019-09-13 14:26 UTC (permalink / raw)
  To: nforro; +Cc: mtk.manpages, linux-man

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ba87bced44ac346f45887c6e91d0d29b0632a7f9.camel@redhat.com>
2019-09-13 14:26 ` [PATCH] mmap.2: fix EINVAL conditions Michael Kerrisk (man-pages)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git