Hi John, Andreas, On 10/19/22 14:25, John Scott wrote:
I'm not subscribed, please CC me. glibc doesn't require_GNU_SOURCE to expose certain MAP_* constants anymore (MAP_ANONYMOUS being particularly noteworthy among them for being on track for POSIX Issue 8). See this commit: https://sourceware.org/git/?p=glibc.git;a=commit;h=954b8f38958de72c4712088735eb175118f17b51 or my glibc bug report which triggered the change at https://sourceware.org/bugzilla/show_bug.cgi?id=29375 This is because POSIX reserves MAP_ constants to the implementation, so their unconditional visibility in sys/mman.h is always allowed. This is also helpful for portable application writers. Other C libraries like musl already exhibit this behavior. Because mmap() is in a POSIX-specific header already, using it with any combination of MAP_ constants doesn't require feature test macros. Thanks for your consideration 0001-Remove-any-feature-test-macro-requirements-for-mmap.patch From 47632888627cac3d0547a969c55d3848b3b350b7 Mon Sep 17 00:00:00 2001 From: John Scott<jscott@xxxxxxxxxx> Date: Wed, 19 Oct 2022 06:25:25 -0400 Subject: [PATCH] Remove any feature test macro requirements for mmap() No feature test macros are required anymore, not even to expose certain constants. See https://sourceware.org/bugzilla/show_bug.cgi?id=29375 --- man2/mmap.2 | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/man2/mmap.2 b/man2/mmap.2 index 9c343f2..8a2bddf 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -32,8 +32,6 @@ Standard C library .BI " int " fd ", off_t " offset ); .BI "int munmap(void *" addr ", size_t " length ); .fi -.PP -See NOTES for information on feature test macro requirements. .SH DESCRIPTION .BR mmap () creates a new mapping in the virtual address space of @@ -727,39 +725,6 @@ flag is specified, and .I addr is 0 (NULL), then the mapped address will be 0 (NULL). .PP -Certain -.I flags -constants are defined only if suitable feature test macros are defined -(possibly by default): -.B _DEFAULT_SOURCE -with glibc 2.19 or later;
We should keep some notice that in the past it was needed. BTW, is glibc backporting the fix to old supported versions?
Thanks, Alex -- <http://www.alejandro-colomar.es/>
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature