| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/bjm.c ./bjm.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/bjm.c 2009-11-06 09:27:46.000000000 -0800 |
| +++ ./bjm.c 2012-03-02 15:17:11.000000000 -0800 |
| @@ -39,7 +39,9 @@ |
| #include <sys/wait.h> |
| #include <sys/resource.h> |
| #include <sys/utsname.h> |
| +#ifndef HAVE_ANDROID_OS |
| #include <sys/user.h> |
| +#endif |
| #include <sys/syscall.h> |
| #include <signal.h> |
| |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/file.c ./file.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/file.c 2011-03-03 18:08:02.000000000 -0800 |
| +++ ./file.c 2012-03-02 15:11:14.000000000 -0800 |
| @@ -45,6 +45,41 @@ |
| # define kernel_dirent dirent |
| #endif |
| |
| +#ifdef HAVE_ANDROID_OS |
| +#include <linux/fadvise.h> |
| + |
| +// ANDROID: From linux/dirent.h |
| + |
| +struct dirent64 { |
| + __u64 d_ino; |
| + __s64 d_off; |
| + unsigned short d_reclen; |
| + unsigned char d_type; |
| + char d_name[256]; |
| +}; |
| + |
| +// ANDROID: From kernel_headers/asm/statfs.h |
| + |
| +/* |
| + * With EABI there is 4 bytes of padding added to this structure. |
| + * Let's pack it so the padding goes away to simplify dual ABI support. |
| + * Note that user space does NOT have to pack this structure. |
| + */ |
| +struct statfs64 { |
| + __u32 f_type; |
| + __u32 f_bsize; |
| + __u64 f_blocks; |
| + __u64 f_bfree; |
| + __u64 f_bavail; |
| + __u64 f_files; |
| + __u64 f_ffree; |
| + __kernel_fsid_t f_fsid; |
| + __u32 f_namelen; |
| + __u32 f_frsize; |
| + __u32 f_spare[5]; |
| +} __attribute__ ((packed,aligned(4))); |
| +#endif /* HAVE_ANDROID_OS */ |
| + |
| #ifdef LINUX |
| # ifdef LINUXSPARC |
| struct stat { |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/ioctl.c ./ioctl.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/ioctl.c 2011-01-15 12:15:31.000000000 -0800 |
| +++ ./ioctl.c 2012-03-02 15:53:36.000000000 -0800 |
| @@ -155,9 +155,11 @@ |
| case 0x03: |
| case 0x12: |
| return block_ioctl(tcp, code, arg); |
| +#ifndef HAVE_ANDROID_OS |
| case 0x22: |
| return scsi_ioctl(tcp, code, arg); |
| #endif |
| +#endif |
| default: |
| break; |
| } |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/ipc.c ./ipc.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/ipc.c 2010-03-31 15:22:01.000000000 -0700 |
| +++ ./ipc.c 2012-03-02 16:12:52.000000000 -0800 |
| @@ -40,9 +40,15 @@ |
| |
| #include <fcntl.h> |
| #include <sys/ipc.h> |
| +#ifdef HAVE_ANDROID_OS |
| +#include <linux/sem.h> |
| +#include <linux/msg.h> |
| +#include <linux/shm.h> |
| +#else |
| #include <sys/sem.h> |
| #include <sys/msg.h> |
| #include <sys/shm.h> |
| +#endif |
| |
| #ifndef MSG_STAT |
| #define MSG_STAT 11 |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/process.c ./process.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/process.c 2011-03-14 14:58:59.000000000 -0700 |
| +++ ./process.c 2012-03-02 15:16:28.000000000 -0800 |
| @@ -45,7 +45,11 @@ |
| #include <sys/wait.h> |
| #include <sys/resource.h> |
| #include <sys/utsname.h> |
| +#ifdef HAVE_ANDROID_OS |
| +#include <asm/user.h> |
| +#else |
| #include <sys/user.h> |
| +#endif |
| #include <sys/syscall.h> |
| #include <signal.h> |
| #ifdef SUNOS4 |
| @@ -114,6 +118,10 @@ |
| #define GETGROUPS32_T __kernel_gid32_t |
| #endif /* LINUX */ |
| |
| +#ifdef HAVE_ANDROID_OS |
| +#define __sched_priority sched_priority |
| +#endif |
| + |
| #if defined(LINUX) && defined(IA64) |
| # include <asm/ptrace_offsets.h> |
| # include <asm/rse.h> |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/signal.c ./signal.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/signal.c 2011-03-10 15:14:47.000000000 -0800 |
| +++ ./signal.c 2012-03-02 15:22:07.000000000 -0800 |
| @@ -37,9 +37,17 @@ |
| |
| #include <stdint.h> |
| #include <signal.h> |
| +#ifndef HAVE_ANDROID_OS |
| #include <sys/user.h> |
| +#endif |
| #include <fcntl.h> |
| |
| +#ifdef HAVE_ANDROID_OS |
| +//FIXME use "sigprocmask" or something |
| +#define sigmask(sig) (1UL << ((sig) - 1)) |
| +#define sigcontext_struct sigcontext |
| +#endif |
| + |
| #ifdef SVR4 |
| #include <sys/ucontext.h> |
| #endif /* SVR4 */ |
| @@ -455,7 +463,7 @@ |
| |
| #endif /* LINUX */ |
| |
| -#if __GLIBC_MINOR__ < 1 |
| +#if __GLIBC_MINOR__ < 1 && !defined(HAVE_ANDROID_OS) |
| /* Type for data associated with a signal. */ |
| typedef union sigval |
| { |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/syscall.c ./syscall.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/syscall.c 2011-02-18 16:02:27.000000000 -0800 |
| +++ ./syscall.c 2012-03-02 15:00:35.000000000 -0800 |
| @@ -38,10 +38,16 @@ |
| #include <signal.h> |
| #include <time.h> |
| #include <errno.h> |
| +#ifndef HAVE_ANDROID_OS |
| #include <sys/user.h> |
| +#endif |
| #include <sys/syscall.h> |
| #include <sys/param.h> |
| |
| +#ifdef HAVE_ANDROID_OS |
| +#include "syscall-android.h" |
| +#endif |
| + |
| #ifdef HAVE_SYS_REG_H |
| #include <sys/reg.h> |
| #ifndef PTRACE_PEEKUSR |
| @@ -2600,6 +2606,7 @@ |
| } |
| |
| switch (known_scno(tcp)) { |
| +#ifndef __ARM_EABI__ |
| #ifdef SYS_socket_subcall |
| case SYS_socketcall: |
| decode_subcall(tcp, SYS_socket_subcall, |
| @@ -2612,6 +2619,7 @@ |
| SYS_ipc_nsubcalls, shift_style); |
| break; |
| #endif |
| +#endif |
| #ifdef SVR4 |
| #ifdef SYS_pgrpsys_subcall |
| case SYS_pgrpsys: |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/system.c ./system.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/system.c 2011-02-22 02:22:13.000000000 -0800 |
| +++ ./system.c 2012-03-02 15:50:24.000000000 -0800 |
| @@ -32,6 +32,11 @@ |
| |
| #include "defs.h" |
| |
| +#ifdef HAVE_ANDROID_OS |
| +#undef __unused |
| +#include <linux/socket.h> |
| +#endif |
| + |
| #ifdef LINUX |
| #define _LINUX_SOCKET_H |
| #define _LINUX_FS_H |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/time.c ./time.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/time.c 2011-03-03 18:08:02.000000000 -0800 |
| +++ ./time.c 2012-03-02 15:23:05.000000000 -0800 |
| @@ -33,7 +33,11 @@ |
| |
| #ifdef LINUX |
| #include <linux/version.h> |
| +#ifdef HAVE_ANDROID_OS |
| +#include <linux/timex.h> |
| +#else |
| #include <sys/timex.h> |
| +#endif |
| #include <linux/ioctl.h> |
| #include <linux/rtc.h> |
| |
| diff -r -u -d /Users/jeffbrown/Downloads/strace-4.6/util.c ./util.c |
| --- /Users/jeffbrown/Downloads/strace-4.6/util.c 2011-03-03 18:08:02.000000000 -0800 |
| +++ ./util.c 2012-03-02 15:01:45.000000000 -0800 |
| @@ -37,7 +37,9 @@ |
| |
| #include <signal.h> |
| #include <sys/syscall.h> |
| +#ifndef HAVE_ANDROID_OS |
| #include <sys/user.h> |
| +#endif |
| #include <sys/param.h> |
| #include <fcntl.h> |
| #if HAVE_SYS_UIO_H |
| @@ -49,6 +51,10 @@ |
| #include <link.h> |
| #endif /* SUNOS4 */ |
| |
| +#ifdef HAVE_ANDROID_OS |
| +#include "syscall-android.h" |
| +#endif |
| + |
| #if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)) |
| #include <linux/ptrace.h> |
| #endif |