• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/bjm.c ./bjm.c
2--- /Users/jeffbrown/Downloads/strace-4.6/bjm.c	2009-11-06 09:27:46.000000000 -0800
3+++ ./bjm.c	2012-03-02 15:17:11.000000000 -0800
4@@ -39,7 +39,9 @@
5 #include <sys/wait.h>
6 #include <sys/resource.h>
7 #include <sys/utsname.h>
8+#ifndef HAVE_ANDROID_OS
9 #include <sys/user.h>
10+#endif
11 #include <sys/syscall.h>
12 #include <signal.h>
13
14diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/file.c ./file.c
15--- /Users/jeffbrown/Downloads/strace-4.6/file.c	2011-03-03 18:08:02.000000000 -0800
16+++ ./file.c	2012-03-02 15:11:14.000000000 -0800
17@@ -45,6 +45,41 @@
18 # define kernel_dirent dirent
19 #endif
20
21+#ifdef HAVE_ANDROID_OS
22+#include <linux/fadvise.h>
23+
24+// ANDROID: From linux/dirent.h
25+
26+struct dirent64 {
27+ __u64 d_ino;
28+ __s64 d_off;
29+ unsigned short d_reclen;
30+ unsigned char d_type;
31+ char d_name[256];
32+};
33+
34+// ANDROID: From kernel_headers/asm/statfs.h
35+
36+/*
37+ * With EABI there is 4 bytes of padding added to this structure.
38+ * Let's pack it so the padding goes away to simplify dual ABI support.
39+ * Note that user space does NOT have to pack this structure.
40+ */
41+struct statfs64 {
42+        __u32 f_type;
43+        __u32 f_bsize;
44+        __u64 f_blocks;
45+        __u64 f_bfree;
46+        __u64 f_bavail;
47+        __u64 f_files;
48+        __u64 f_ffree;
49+        __kernel_fsid_t f_fsid;
50+        __u32 f_namelen;
51+        __u32 f_frsize;
52+        __u32 f_spare[5];
53+} __attribute__ ((packed,aligned(4)));
54+#endif /* HAVE_ANDROID_OS */
55+
56 #ifdef LINUX
57 #  ifdef LINUXSPARC
58 struct stat {
59diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/ioctl.c ./ioctl.c
60--- /Users/jeffbrown/Downloads/strace-4.6/ioctl.c	2011-01-15 12:15:31.000000000 -0800
61+++ ./ioctl.c	2012-03-02 15:53:36.000000000 -0800
62@@ -155,9 +155,11 @@
63 	case 0x03:
64 	case 0x12:
65 		return block_ioctl(tcp, code, arg);
66+#ifndef HAVE_ANDROID_OS
67 	case 0x22:
68 		return scsi_ioctl(tcp, code, arg);
69 #endif
70+#endif
71 	default:
72 		break;
73 	}
74diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/ipc.c ./ipc.c
75--- /Users/jeffbrown/Downloads/strace-4.6/ipc.c	2010-03-31 15:22:01.000000000 -0700
76+++ ./ipc.c	2012-03-02 16:12:52.000000000 -0800
77@@ -40,9 +40,15 @@
78
79 #include <fcntl.h>
80 #include <sys/ipc.h>
81+#ifdef HAVE_ANDROID_OS
82+#include <linux/sem.h>
83+#include <linux/msg.h>
84+#include <linux/shm.h>
85+#else
86 #include <sys/sem.h>
87 #include <sys/msg.h>
88 #include <sys/shm.h>
89+#endif
90
91 #ifndef MSG_STAT
92 #define MSG_STAT 11
93diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/process.c ./process.c
94--- /Users/jeffbrown/Downloads/strace-4.6/process.c	2011-03-14 14:58:59.000000000 -0700
95+++ ./process.c	2012-03-02 15:16:28.000000000 -0800
96@@ -45,7 +45,11 @@
97 #include <sys/wait.h>
98 #include <sys/resource.h>
99 #include <sys/utsname.h>
100+#ifdef HAVE_ANDROID_OS
101+#include <asm/user.h>
102+#else
103 #include <sys/user.h>
104+#endif
105 #include <sys/syscall.h>
106 #include <signal.h>
107 #ifdef SUNOS4
108@@ -114,6 +118,10 @@
109 #define GETGROUPS32_T __kernel_gid32_t
110 #endif /* LINUX */
111
112+#ifdef HAVE_ANDROID_OS
113+#define __sched_priority sched_priority
114+#endif
115+
116 #if defined(LINUX) && defined(IA64)
117 # include <asm/ptrace_offsets.h>
118 # include <asm/rse.h>
119diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/signal.c ./signal.c
120--- /Users/jeffbrown/Downloads/strace-4.6/signal.c	2011-03-10 15:14:47.000000000 -0800
121+++ ./signal.c	2012-03-02 15:22:07.000000000 -0800
122@@ -37,9 +37,17 @@
123
124 #include <stdint.h>
125 #include <signal.h>
126+#ifndef HAVE_ANDROID_OS
127 #include <sys/user.h>
128+#endif
129 #include <fcntl.h>
130
131+#ifdef HAVE_ANDROID_OS
132+//FIXME use "sigprocmask" or something
133+#define sigmask(sig)    (1UL << ((sig) - 1))
134+#define sigcontext_struct sigcontext
135+#endif
136+
137 #ifdef SVR4
138 #include <sys/ucontext.h>
139 #endif /* SVR4 */
140@@ -455,7 +463,7 @@
141
142 #endif /* LINUX */
143
144-#if __GLIBC_MINOR__ < 1
145+#if __GLIBC_MINOR__ < 1 && !defined(HAVE_ANDROID_OS)
146 /* Type for data associated with a signal.  */
147 typedef union sigval
148 {
149diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/strace.c ./strace.c
150--- /Users/jeffbrown/Downloads/strace-4.6/strace.c	2011-03-10 14:25:03.000000000 -0800
151+++ ./strace.c	2012-03-02 16:55:15.000000000 -0800
152@@ -38,7 +38,10 @@
153 #include <sys/param.h>
154 #include <fcntl.h>
155 #include <sys/resource.h>
156+#ifdef HAVE_ANDROID_OS
157+#define wait4 __wait4
158 #include <sys/wait.h>
159+#endif
160 #include <sys/stat.h>
161 #include <pwd.h>
162 #include <grp.h>
163diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/syscall.c ./syscall.c
164--- /Users/jeffbrown/Downloads/strace-4.6/syscall.c	2011-02-18 16:02:27.000000000 -0800
165+++ ./syscall.c	2012-03-02 15:00:35.000000000 -0800
166@@ -38,10 +38,16 @@
167 #include <signal.h>
168 #include <time.h>
169 #include <errno.h>
170+#ifndef HAVE_ANDROID_OS
171 #include <sys/user.h>
172+#endif
173 #include <sys/syscall.h>
174 #include <sys/param.h>
175
176+#ifdef HAVE_ANDROID_OS
177+#include "syscall-android.h"
178+#endif
179+
180 #ifdef HAVE_SYS_REG_H
181 #include <sys/reg.h>
182 #ifndef PTRACE_PEEKUSR
183@@ -2600,6 +2606,7 @@
184 	}
185
186 	switch (known_scno(tcp)) {
187+#ifndef __ARM_EABI__
188 #ifdef SYS_socket_subcall
189 	case SYS_socketcall:
190 		decode_subcall(tcp, SYS_socket_subcall,
191@@ -2612,6 +2619,7 @@
192 			SYS_ipc_nsubcalls, shift_style);
193 		break;
194 #endif
195+#endif
196 #ifdef SVR4
197 #ifdef SYS_pgrpsys_subcall
198 	case SYS_pgrpsys:
199diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/system.c ./system.c
200--- /Users/jeffbrown/Downloads/strace-4.6/system.c	2011-02-22 02:22:13.000000000 -0800
201+++ ./system.c	2012-03-02 15:50:24.000000000 -0800
202@@ -32,6 +32,11 @@
203
204 #include "defs.h"
205
206+#ifdef HAVE_ANDROID_OS
207+#undef __unused
208+#include <linux/socket.h>
209+#endif
210+
211 #ifdef LINUX
212 #define _LINUX_SOCKET_H
213 #define _LINUX_FS_H
214diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/time.c ./time.c
215--- /Users/jeffbrown/Downloads/strace-4.6/time.c	2011-03-03 18:08:02.000000000 -0800
216+++ ./time.c	2012-03-02 15:23:05.000000000 -0800
217@@ -33,7 +33,11 @@
218
219 #ifdef LINUX
220 #include <linux/version.h>
221+#ifdef HAVE_ANDROID_OS
222+#include <linux/timex.h>
223+#else
224 #include <sys/timex.h>
225+#endif
226 #include <linux/ioctl.h>
227 #include <linux/rtc.h>
228
229diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/util.c ./util.c
230--- /Users/jeffbrown/Downloads/strace-4.6/util.c	2011-03-03 18:08:02.000000000 -0800
231+++ ./util.c	2012-03-02 15:01:45.000000000 -0800
232@@ -37,7 +37,9 @@
233
234 #include <signal.h>
235 #include <sys/syscall.h>
236+#ifndef HAVE_ANDROID_OS
237 #include <sys/user.h>
238+#endif
239 #include <sys/param.h>
240 #include <fcntl.h>
241 #if HAVE_SYS_UIO_H
242@@ -49,6 +51,10 @@
243 #include <link.h>
244 #endif /* SUNOS4 */
245
246+#ifdef HAVE_ANDROID_OS
247+#include "syscall-android.h"
248+#endif
249+
250 #if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
251 #include <linux/ptrace.h>
252 #endif
253