]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
madvise.2: document reliable probe for advice support
authorZach O'Keefe <zokeefe@google.com>
Fri, 21 Oct 2022 22:32:58 +0000 (15:32 -0700)
committerAlejandro Colomar <alx@kernel.org>
Sun, 30 Oct 2022 11:43:55 +0000 (12:43 +0100)
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>
man2/madvise.2

index 48bda703c8bf877356180d43184cf335903a90fd..e8f2035a048c74642c866a2a5560f880733345c6 100644 (file)
@@ -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 ()