]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
manual: mention PKEY_UNRESTRICTED macro in the manual
authorYury Khrustalev <yury.khrustalev@arm.com>
Tue, 27 May 2025 10:10:12 +0000 (11:10 +0100)
committerYury Khrustalev <yury.khrustalev@arm.com>
Wed, 28 May 2025 10:00:02 +0000 (11:00 +0100)
Also use this macro in one of the examples.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
manual/memory.texi

index 9a29c7d1339306fb04ad701b428e74f49410ff50..46f76c17ca72ab280ae745b9ed9a3eea947de7a9 100644 (file)
@@ -3139,7 +3139,7 @@ used to temporarily acquire access to the memory region and relinquish
 it again:
 
 @smallexample
-  if (key >= 0 && pkey_set (key, 0) < 0)
+  if (key >= 0 && pkey_set (key, PKEY_UNRESTRICTED) < 0)
     ...; /* Perform error checking (generally fatal).  */
   /* At this point, the current thread has read-write access to the
      memory region.  */
@@ -3256,9 +3256,9 @@ not @math{-1}.
 @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}}
 Change the access restrictions of the current thread for memory pages with
 the protection key @var{key} to @var{access_restrictions}.  If
-@var{access_restrictions} is zero, no additional access restrictions on top of
-the page protection flags are applied.  Otherwise, @var{access_restrictions} is
-a combination of the following flags:
+@var{access_restrictions} is @code{PKEY_UNRESTRICTED} (zero), no additional
+access restrictions on top of the page protection flags are applied.  Otherwise,
+@var{access_restrictions} is a combination of the following flags:
 
 @vtable @code
 @item PKEY_DISABLE_READ