Skip to content

Commit

Permalink
tools/testing/selftests/ptrace/peeksiginfo.c: add PAGE_SIZE definition
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Andrey Vagin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Thierry Fauck authored and torvalds committed Aug 8, 2014
1 parent 89b3ac6 commit 8b6aaf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/testing/selftests/ptrace/peeksiginfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down

0 comments on commit 8b6aaf6

Please sign in to comment.