diff --git a/manual/memory.texi b/manual/memory.texi index a1435aa..4731a38 100644 --- a/manual/memory.texi +++ b/manual/memory.texi @@ -3289,6 +3289,10 @@ in which memory protection keys are disabled. @item ENOSPC All available protection keys already have been allocated. + +The system does not implement memory protection keys or runs in a mode +in which memory protection keys are disabled. + @end table @end deftypefun diff --git a/sysdeps/unix/sysv/linux/tst-pkey.c b/sysdeps/unix/sysv/linux/tst-pkey.c index 600b6f0..40d7e9f 100644 --- a/sysdeps/unix/sysv/linux/tst-pkey.c +++ b/sysdeps/unix/sysv/linux/tst-pkey.c @@ -199,6 +199,10 @@ do_test (void) if (errno == EINVAL) FAIL_UNSUPPORTED ("CPU does not support memory protection keys: %m"); + if (errno == ENOSPC) + FAIL_UNSUPPORTED + ("no keys available or kernel does not support memory" + " protection keys"); FAIL_EXIT1 ("pkey_alloc: %m"); } TEST_COMPARE (pkey_get (keys[0]), 0);