From: Mark Wielaard Date: Wed, 29 May 2019 23:05:55 +0000 (+0200) Subject: pkey_alloc.2, mprotect.2: _GNU_SOURCE is required for the pkey functions. X-Git-Tag: man-pages-5.02~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f92ea96babd20a4cdbe92c33871d7a19f190c2e5;p=thirdparty%2Fman-pages.git 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 Signed-off-by: Mark Wielaard Signed-off-by: Michael Kerrisk --- diff --git a/man2/mprotect.2 b/man2/mprotect.2 index cbbfd51377..866ac7736b 100644 --- a/man2/mprotect.2 +++ b/man2/mprotect.2 @@ -38,6 +38,10 @@ mprotect, pkey_mprotect \- set protection on a region of memory .B #include .PP .BI "int mprotect(void *" addr ", size_t " len ", int " prot ); + +.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" +.B #include +.PP .BI "int pkey_mprotect(void *" addr ", size_t " len ", int " prot ", int " pkey "); .fi .SH DESCRIPTION diff --git a/man2/pkey_alloc.2 b/man2/pkey_alloc.2 index ce9bd96cd5..d82f316a82 100644 --- a/man2/pkey_alloc.2 +++ b/man2/pkey_alloc.2 @@ -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 .PP .BI "int pkey_alloc(unsigned int " flags ", unsigned int " access_rights ");"