All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/proc: include linux/mman.h for MREMAP_DONTUNMAP
@ 2026-11-20  2:27 Qingshuang Fu
  2026-11-20  3:24 ` Andrew Morton
  2026-11-20  3:24 ` + selftests-proc-include-linux-mmanh-for-mremap_dontunmap.patch added to mm-new branch Andrew Morton
  0 siblings, 2 replies; 3+ messages in thread
From: Qingshuang Fu @ 2026-11-20  2:27 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches, Shuah Khan, Andrew Morton,
	Suren Baghdasaryan, Liam R . Howlett, Karl Mehltretter,
	Bala-Vignesh-Reddy
  Cc: linux-fsdevel, linux-kselftest, linux-kernel, Qingshuang Fu

glibc versions before 2.32 do not define MREMAP_DONTUNMAP in
<sys/mman.h>, so proc-maps-race fails to build against them (e.g.
glibc 2.31):

  $ make -C tools/testing/selftests TARGETS=proc
  ...
  proc-maps-race.c:691:58: error: 'MREMAP_DONTUNMAP' undeclared
    (first use in this function)

Include <linux/mman.h> to get the flag from the kernel UAPI headers
instead of depending on the libc version.  The proc Makefile already
adds those headers to the include path via $(TOOLS_INCLUDES).

Fixes: 6a45336b9b6f ("selftests/proc: extend /proc/pid/maps tearing test to include vma remapping")
Signed-off-by: Qingshuang Fu <fuqingshuang@kylinos.cn>
---
 tools/testing/selftests/proc/proc-maps-race.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/proc/proc-maps-race.c b/tools/testing/selftests/proc/proc-maps-race.c
index bf4c5073f6fc..7d2d9144fedf 100644
--- a/tools/testing/selftests/proc/proc-maps-race.c
+++ b/tools/testing/selftests/proc/proc-maps-race.c
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <linux/fs.h>
+#include <linux/mman.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>

base-commit: 20eef29b7c8465ac98d7dd6d6f2ac07a8d8056ca
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-20  3:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20  2:27 [PATCH] selftests/proc: include linux/mman.h for MREMAP_DONTUNMAP Qingshuang Fu
2026-11-20  3:24 ` Andrew Morton
2026-11-20  3:24 ` + selftests-proc-include-linux-mmanh-for-mremap_dontunmap.patch added to mm-new branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.