From 7208ad0a3d7db1eabcc95dfe20781ffd128871b2 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 3 Feb 2015 14:31:55 +0100 Subject: [PATCH] madvise.2: MADV_REMOVE can be applied only to shared writable mappings Signed-off-by: Michael Kerrisk --- man2/madvise.2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man2/madvise.2 b/man2/madvise.2 index 638851ba4..dbe1deca1 100644 --- a/man2/madvise.2 +++ b/man2/madvise.2 @@ -146,6 +146,7 @@ error .\" bufferpool (shared memory segments) - without writing back to .\" disk/swap space. This feature is also useful for supporting .\" hot-plug memory on UML. +The specified address range must be mapped shared and writable. This flag cannot be applied to locked pages or Huge TLB pages. .TP .BR MADV_DONTFORK " (since Linux 2.6.16)" @@ -324,6 +325,12 @@ On error, it returns \-1 and is set appropriately. .SH ERRORS .TP +.B EACCES +.I advice +is +.BR MADV_REMOVE , +but the specified address range is not a shared writable mapping. +.TP .B EAGAIN A kernel resource was temporarily unavailable. .TP