summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch')
-rw-r--r--meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch b/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
new file mode 100644
index 0000000000..b57a006bc6
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc/0001-Use-UINTPTR_MAX-instead-of-__WORDSIZE.patch
@@ -0,0 +1,51 @@
1From 5dc872bb2fba6421cb8e1ee578f7bd4aaed55f61 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 24 Mar 2016 15:46:14 +0000
4Subject: [PATCH] Use UINTPTR_MAX instead of __WORDSIZE
5
6Do not include sys/user.h since it conflicts with
7pt_regs struct from kernel APIs in asm/ptrace.h
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Pending
12
13 src/peekfd.c | 13 ++++++++-----
14 1 file changed, 8 insertions(+), 5 deletions(-)
15
16diff --git a/src/peekfd.c b/src/peekfd.c
17index cba2130..0d39878 100644
18--- a/src/peekfd.c
19+++ b/src/peekfd.c
20@@ -30,8 +30,11 @@
21 #include <asm/ptrace.h>
22 #include <byteswap.h>
23 #include <endian.h>
24+#ifdef __GLIBC__
25 #include <sys/user.h>
26+#endif
27 #include <stdlib.h>
28+#include <stdint.h>
29 #include <getopt.h>
30 #include <ctype.h>
31
32@@ -228,11 +231,11 @@ int main(int argc, char **argv)
33 if (WIFSTOPPED(status)) {
34 #ifdef PPC
35 struct pt_regs regs;
36- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
37- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
38- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
39- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
40- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
41+ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R0, 0);
42+ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R3, 0);
43+ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R4, 0);
44+ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_R5, 0);
45+ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, UINTPTR_MAX/8 * PT_ORIG_R3, 0);
46 #elif defined(ARM)
47 struct pt_regs regs;
48 ptrace(PTRACE_GETREGS, pid, 0, &regs);
49--
501.9.1
51