summaryrefslogtreecommitdiff
path: root/user/psmisc/fix-peekfd-on-ppc.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2017-06-28 10:23:08 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2017-06-28 10:23:33 +0000
commit4dffcd235c726c6425edbdc00a1e4c88b2e0e875 (patch)
tree19a928467d41e2763d76c221d03fad898b8eb846 /user/psmisc/fix-peekfd-on-ppc.patch
parent5383b7106d8806da086b9fd7fa88b66ab4c0ef0c (diff)
downloadpackages-4dffcd235c726c6425edbdc00a1e4c88b2e0e875.tar.gz
packages-4dffcd235c726c6425edbdc00a1e4c88b2e0e875.tar.bz2
packages-4dffcd235c726c6425edbdc00a1e4c88b2e0e875.tar.xz
packages-4dffcd235c726c6425edbdc00a1e4c88b2e0e875.zip
user/psmisc: patches to make peekfd work portably
Diffstat (limited to 'user/psmisc/fix-peekfd-on-ppc.patch')
-rw-r--r--user/psmisc/fix-peekfd-on-ppc.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/user/psmisc/fix-peekfd-on-ppc.patch b/user/psmisc/fix-peekfd-on-ppc.patch
new file mode 100644
index 000000000..d9fc1d5f1
--- /dev/null
+++ b/user/psmisc/fix-peekfd-on-ppc.patch
@@ -0,0 +1,19 @@
+--- psmisc-23.0/src/peekfd.c.old 2017-06-12 00:29:46.000000000 +0000
++++ psmisc-23.0/src/peekfd.c 2017-06-28 10:15:18.635344983 +0000
+@@ -233,11 +233,11 @@
+ if (WIFSTOPPED(status)) {
+ #ifdef PPC
+ struct pt_regs regs;
+- regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R0, 0);
+- regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R3, 0);
+- regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R4, 0);
+- regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_R5, 0);
+- regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, __WORDSIZE/8 * PT_ORIG_R3, 0);
++ regs.gpr[0] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R0, 0);
++ regs.gpr[3] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R3, 0);
++ regs.gpr[4] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R4, 0);
++ regs.gpr[5] = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_R5, 0);
++ regs.orig_gpr3 = ptrace(PTRACE_PEEKUSER, pid, sizeof(void *) * PT_ORIG_R3, 0);
+ #elif defined(ARM)
+ struct pt_regs regs;
+ ptrace(PTRACE_GETREGS, pid, 0, &regs);