madvise.2: Specify MADV_REMOVE returns EINVAL for hugetlbfs

madvise(2) actually returns with error EINVAL for MADV_REMOVE
when used for hugetlb VMAs, not EOPNOTSUPP, and this has been
the case since MADV_REMOVE was introduced in commit f6b3ec238d12
("madvise(MADV_REMOVE): remove pages from tmpfs shm backing
store").

Specify the exact behavior.

Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
David Rientjes 2015-04-02 15:21:50 -07:00 committed by Michael Kerrisk
parent 968b403434
commit 31ddc55d25
1 changed files with 3 additions and 1 deletions

View File

@ -184,7 +184,9 @@ any filesystem which supports the
.BR FALLOC_FL_PUNCH_HOLE
mode also supports
.BR MADV_REMOVE .
Other filesystems fail with the error
Hugetlbfs will fail with the error
.BR EINVAL
and other filesystems fail with the error
.BR EOPNOTSUPP .
.TP
.BR MADV_DONTFORK " (since Linux 2.6.16)"