pkey_alloc.2, mprotect.2: _GNU_SOURCE is required for the pkey functions.

To get the pkey_alloc, pkey_free and pkey_mprotect functions
_GNU_SOURCE needs to be defined before including sys/mman.h.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Mark Wielaard 2019-05-30 01:05:55 +02:00 committed by Michael Kerrisk
parent a4a0b74234
commit f92ea96bab
2 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,10 @@ mprotect, pkey_mprotect \- set protection on a region of memory
.B #include <sys/mman.h>
.PP
.BI "int mprotect(void *" addr ", size_t " len ", int " prot );
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/mman.h>
.PP
.BI "int pkey_mprotect(void *" addr ", size_t " len ", int " prot ", int " pkey ");
.fi
.SH DESCRIPTION

View File

@ -27,6 +27,7 @@
pkey_alloc, pkey_free \- allocate or free a protection key
.SH SYNOPSIS
.nf
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/mman.h>
.PP
.BI "int pkey_alloc(unsigned int " flags ", unsigned int " access_rights ");"