From 286a2642e0d4e8d666cc4f563b3960ce16e006e3 Mon Sep 17 00:00:00 2001 From: Thierry Fauck Date: Fri, 8 Aug 2014 14:22:46 -0700 Subject: [PATCH] tools/testing/selftests/ptrace/peeksiginfo.c: add PAGE_SIZE definition BugLink: http://bugs.launchpad.net/bugs/1358855 On IBM powerpc where multiple page size value are supported, current ppc64 and ppc64el distro don't define the PAGE_SIZE variable in /usr/include as this is a dynamic value retrieved by the getpagesize() or sysconf() defined in unistd.h. The PAGE_SIZE variable sounds defined when only one value is supported by the kernel. As such, when the PAGE_SIZE definition doesn't exist system should retrieve the dynamic value. Signed-off-by: Thierry Fauck Cc: Andrey Vagin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 8b6aaf65d3b001ec9b5dcba0992b3b68cbf6057f) Signed-off-by: Tim Gardner --- tools/testing/selftests/ptrace/peeksiginfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace/peeksiginfo.c index d46558b..c34cd8a 100644 --- a/tools/testing/selftests/ptrace/peeksiginfo.c +++ b/tools/testing/selftests/ptrace/peeksiginfo.c @@ -31,6 +31,10 @@ static int sys_ptrace(int request, pid_t pid, void *addr, void *data) #define TEST_SICODE_PRIV -1 #define TEST_SICODE_SHARE -2 +#ifndef PAGE_SIZE +#define PAGE_SIZE sysconf(_SC_PAGESIZE) +#endif + #define err(fmt, ...) \ fprintf(stderr, \ "Error (%s:%d): " fmt, \ -- 1.9.1