]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
kselftest/vm: fix tests build with old libc
authorChengming Zhou <zhouchengming@bytedance.com>
Sat, 5 Mar 2022 04:29:04 +0000 (20:29 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 13:17:57 +0000 (15:17 +0200)
commit0624adba7e9f9d005790b38fa3151a17e8356ce6
tree918c67230f45e78b6b0c9199e9e37d0c05f899ac
parent9babe128b20b9227a0eaa5a4afd6ae5308e87bd1
kselftest/vm: fix tests build with old libc

BugLink: https://bugs.launchpad.net/bugs/1969678
[ Upstream commit b773827e361952b3f53ac6fa4c4e39ccd632102e ]

The error message when I build vm tests on debian10 (GLIBC 2.28):

    userfaultfd.c: In function `userfaultfd_pagemap_test':
    userfaultfd.c:1393:37: error: `MADV_PAGEOUT' undeclared (first use
    in this function); did you mean `MADV_RANDOM'?
      if (madvise(area_dst, test_pgsize, MADV_PAGEOUT))
                                         ^~~~~~~~~~~~
                                         MADV_RANDOM

This patch includes these newer definitions from UAPI linux/mman.h, is
useful to fix tests build on systems without these definitions in glibc
sys/mman.h.

Link: https://lkml.kernel.org/r/20220227055330.43087-2-zhouchengming@bytedance.com
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/vm/userfaultfd.c