aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach O'Keefe <zokeefe@google.com>2022-10-21 15:32:58 -0700
committerAlejandro Colomar <alx@kernel.org>2022-10-30 12:43:55 +0100
commitbd14f1e3236a1f016b7a8a85deb34379c4470687 (patch)
tree912e0979304d752663f864e3cdaee7eaed94bcdc
parent797a95e0e67a71deda18c0f6a1c3159cd9c12832 (diff)
downloadman-pages-bd14f1e3236a1f016b7a8a85deb34379c4470687.tar.gz
madvise.2: document reliable probe for advice support
EINVAL is an overloaded error code for madvise(2) and it's not clear under what context it means "advice is not valid" vs another error. Explicitly document that madvise(0, 0, advice) can reliably be used to probe for kernel support for "advice", returning zero iff "advice" is supported by the kernel. Signed-off-by: Zach O'Keefe <zokeefe@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man2/madvise.25
1 files changed, 5 insertions, 0 deletions
diff --git a/man2/madvise.2 b/man2/madvise.2
index 48bda703c8..e8f2035a04 100644
--- a/man2/madvise.2
+++ b/man2/madvise.2
@@ -791,6 +791,11 @@ that are not mapped, the Linux version of
ignores them and applies the call to the rest (but returns
.B ENOMEM
from the system call, as it should).
+.PP
+.IR madvise(0,\ 0,\ advice)
+will return zero iff
+.I advice
+is supported by the kernel and can be relied on to probe for support.
.\" .SH HISTORY
.\" The
.\" .BR madvise ()