1 |
From 02c435a25383682b73aa475781e460910a97e063 Mon Sep 17 00:00:00 2001 |
2 |
From: Sasha Levin <sashal@kernel.org> |
3 |
Date: Fri, 4 Mar 2022 20:29:04 -0800 |
4 |
Subject: kselftest/vm: fix tests build with old libc |
5 |
|
6 |
From: Chengming Zhou <zhouchengming@bytedance.com> |
7 |
|
8 |
[ Upstream commit b773827e361952b3f53ac6fa4c4e39ccd632102e ] |
9 |
|
10 |
The error message when I build vm tests on debian10 (GLIBC 2.28): |
11 |
|
12 |
userfaultfd.c: In function `userfaultfd_pagemap_test': |
13 |
userfaultfd.c:1393:37: error: `MADV_PAGEOUT' undeclared (first use |
14 |
in this function); did you mean `MADV_RANDOM'? |
15 |
if (madvise(area_dst, test_pgsize, MADV_PAGEOUT)) |
16 |
^~~~~~~~~~~~ |
17 |
MADV_RANDOM |
18 |
|
19 |
This patch includes these newer definitions from UAPI linux/mman.h, is |
20 |
useful to fix tests build on systems without these definitions in glibc |
21 |
sys/mman.h. |
22 |
|
23 |
Link: https://lkml.kernel.org/r/20220227055330.43087-2-zhouchengming@bytedance.com |
24 |
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com> |
25 |
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> |
26 |
Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
27 |
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
28 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
29 |
--- |
30 |
tools/testing/selftests/vm/userfaultfd.c | 1 + |
31 |
1 file changed, 1 insertion(+) |
32 |
|
33 |
--- a/tools/testing/selftests/vm/userfaultfd.c |
34 |
+++ b/tools/testing/selftests/vm/userfaultfd.c |
35 |
@@ -46,6 +46,7 @@ |
36 |
#include <signal.h> |
37 |
#include <poll.h> |
38 |
#include <string.h> |
39 |
+#include <linux/mman.h> |
40 |
#include <sys/mman.h> |
41 |
#include <sys/syscall.h> |
42 |
#include <sys/ioctl.h> |