aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manual/memory.texi4
-rw-r--r--sysdeps/unix/sysv/linux/tst-pkey.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/manual/memory.texi b/manual/memory.texi
index b565dd69f2..aa5011e4f9 100644
--- a/manual/memory.texi
+++ b/manual/memory.texi
@@ -3288,6 +3288,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 4c4fbae3ad..4ea1bc4f9a 100644
--- a/sysdeps/unix/sysv/linux/tst-pkey.c
+++ b/sysdeps/unix/sysv/linux/tst-pkey.c
@@ -197,6 +197,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);