Hello Mark, On 5/30/19 1:08 AM, Mark Wielaard wrote:
The mprotect.2 NOTES say: On systems that do not support protection keys in hardware, pkey_mprotect() may still be used, but pkey must be set to 0. When called this way, the operation of pkey_mprotect() is equivalent to mprotect(). But this is not what the glibc manual says: It is also possible to call pkey_mprotect with a key value of -1, in which case it will behave in the same way as mprotect. Which is correct. Both the glibc implementation and the kernel check whether pkey is -1. 0 is not a valid pkey when memory protection keys are not supported in hardware. Signed-off-by: Mark Wielaard <mark@xxxxxxxxx>
Thanks. Patch applied. Cheers, Michael
--- man2/mprotect.2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man2/mprotect.2 b/man2/mprotect.2 index 4d29f66..866ac77 100644 --- a/man2/mprotect.2 +++ b/man2/mprotect.2 @@ -278,7 +278,7 @@ On systems that do not support protection keys in hardware, .BR pkey_mprotect () may still be used, but .IR pkey -must be set to 0. +must be set to -1. When called this way, the operation of .BR pkey_mprotect () is equivalent to