linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] maps.2: fd for a file mapping must be opened for reading
@ 2014-04-04  8:24 Andrey Vagin
  2014-04-04 11:27 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Vagin @ 2014-04-04  8:24 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: linux-man, linux-kernel, linux-mm, Andrey Vagin

Here is no difference between MAP_SHARED and MAP_PRIVATE.

do_mmap_pgoff()
	switch (flags & MAP_TYPE) {
	case MAP_SHARED:
	...
	/* fall through */
	case MAP_PRIVATE:
		if (!(file->f_mode & FMODE_READ))
			return -EACCES;

Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 man2/mmap.2 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/man2/mmap.2 b/man2/mmap.2
index c0fd321..b469f84 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -393,9 +393,7 @@ is set (probably to
 .TP
 .B EACCES
 A file descriptor refers to a non-regular file.
-Or
-.B MAP_PRIVATE
-was requested, but
+Or a file mapping was requested, but
 .I fd
 is not open for reading.
 Or
-- 
1.8.5.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] maps.2: fd for a file mapping must be opened for reading
  2014-04-04  8:24 [PATCH] maps.2: fd for a file mapping must be opened for reading Andrey Vagin
@ 2014-04-04 11:27 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-04-04 11:27 UTC (permalink / raw)
  To: Andrey Vagin; +Cc: mtk.manpages, linux-man, linux-kernel, linux-mm

On 04/04/2014 10:24 AM, Andrey Vagin wrote:
> Here is no difference between MAP_SHARED and MAP_PRIVATE.

Thanks, Andrey. That man page text has been there for a very long time,
but but does not seem to correspond to the truth in any kernel version
going back even to Linux 1.0. Patch applied.

Cheers,

Michael


> do_mmap_pgoff()
> 	switch (flags & MAP_TYPE) {
> 	case MAP_SHARED:
> 	...
> 	/* fall through */
> 	case MAP_PRIVATE:
> 		if (!(file->f_mode & FMODE_READ))
> 			return -EACCES;
> 
> Signed-off-by: Andrey Vagin <avagin@openvz.org>
> ---
>  man2/mmap.2 | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/man2/mmap.2 b/man2/mmap.2
> index c0fd321..b469f84 100644
> --- a/man2/mmap.2
> +++ b/man2/mmap.2
> @@ -393,9 +393,7 @@ is set (probably to
>  .TP
>  .B EACCES
>  A file descriptor refers to a non-regular file.
> -Or
> -.B MAP_PRIVATE
> -was requested, but
> +Or a file mapping was requested, but
>  .I fd
>  is not open for reading.
>  Or
> 


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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-04 11:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04  8:24 [PATCH] maps.2: fd for a file mapping must be opened for reading Andrey Vagin
2014-04-04 11:27 ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox