Home | History | Annotate | Download | only in strace
      1 diff -r -u -d /tmp/strace-4.6/bjm.c ./bjm.c
      2 --- /tmp/strace-4.6/bjm.c	2009-11-06 09:27:46.000000000 -0800
      3 +++ ./bjm.c	2013-01-04 12:26:34.977221825 -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  
     14 diff -r -u -d /tmp/strace-4.6/defs.h ./defs.h
     15 --- /tmp/strace-4.6/defs.h	2011-03-15 10:19:09.000000000 -0700
     16 +++ ./defs.h	2013-01-04 12:26:34.977221825 -0800
     17 @@ -33,10 +33,6 @@
     18  #include "config.h"
     19  #endif
     20  
     21 -#ifdef MIPS
     22 -#include <sgidefs.h>
     23 -#endif
     24 -
     25  #ifdef linux
     26  #include <features.h>
     27  #endif
     28 diff -r -u -d /tmp/strace-4.6/file.c ./file.c
     29 --- /tmp/strace-4.6/file.c	2011-03-03 18:08:02.000000000 -0800
     30 +++ ./file.c	2013-01-04 12:26:34.977221825 -0800
     31 @@ -45,6 +45,60 @@
     32  # define kernel_dirent dirent
     33  #endif
     34  
     35 +#ifdef HAVE_ANDROID_OS
     36 +#include <linux/fadvise.h>
     37 +
     38 +// ANDROID: From linux/dirent.h
     39 +
     40 +struct dirent64 {
     41 + __u64 d_ino;
     42 + __s64 d_off;
     43 + unsigned short d_reclen;
     44 + unsigned char d_type;
     45 + char d_name[256];
     46 +};
     47 +
     48 +// ANDROID: From kernel_headers/asm/statfs.h
     49 +
     50 +#if !defined(MIPS)
     51 +/*
     52 + * With EABI there is 4 bytes of padding added to this structure.
     53 + * Let's pack it so the padding goes away to simplify dual ABI support.
     54 + * Note that user space does NOT have to pack this structure.
     55 + */
     56 +struct statfs64 {
     57 +        __u32 f_type;
     58 +        __u32 f_bsize;
     59 +        __u64 f_blocks;
     60 +        __u64 f_bfree;
     61 +        __u64 f_bavail;
     62 +        __u64 f_files;
     63 +        __u64 f_ffree;
     64 +        __kernel_fsid_t f_fsid;
     65 +        __u32 f_namelen;
     66 +        __u32 f_frsize;
     67 +        __u32 f_spare[5];
     68 +} __attribute__ ((packed,aligned(4)));
     69 +#else
     70 +struct statfs64 {
     71 +	__u32 f_type;
     72 +	__u32 f_bsize;
     73 +	__u32 f_frsize;
     74 +	__u32 __pad;
     75 +	__u64 f_blocks;
     76 +	__u64 f_bfree;
     77 +	__u64 f_files;
     78 +	__u64 f_ffree;
     79 +	__u64 f_bavail;
     80 +	__kernel_fsid_t f_fsid;
     81 +	__u32 f_namelen;
     82 +	__u32 f_spare[6];
     83 +};
     84 +#endif
     85 +
     86 +
     87 +#endif /* HAVE_ANDROID_OS */
     88 +
     89  #ifdef LINUX
     90  #  ifdef LINUXSPARC
     91  struct stat {
     92 @@ -1732,11 +1786,19 @@
     93  		(unsigned long)statbuf.f_bsize,
     94  		(unsigned long)statbuf.f_blocks,
     95  		(unsigned long)statbuf.f_bfree);
     96 +#ifdef MIPS
     97 +	tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%ld, %ld}",
     98 +		(unsigned long)statbuf.f_bavail,
     99 +		(unsigned long)statbuf.f_files,
    100 +		(unsigned long)statbuf.f_ffree,
    101 +		statbuf.f_fsid.val[0], statbuf.f_fsid.val[1]);
    102 +#else
    103  	tprintf("f_bavail=%lu, f_files=%lu, f_ffree=%lu, f_fsid={%d, %d}",
    104  		(unsigned long)statbuf.f_bavail,
    105  		(unsigned long)statbuf.f_files,
    106  		(unsigned long)statbuf.f_ffree,
    107  		statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
    108 +#endif
    109  #ifdef LINUX
    110  	tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
    111  #endif /* LINUX */
    112 @@ -1790,11 +1852,19 @@
    113  		(unsigned long long)statbuf.f_bsize,
    114  		(unsigned long long)statbuf.f_blocks,
    115  		(unsigned long long)statbuf.f_bfree);
    116 +#ifdef MIPS
    117 +	tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%ld, %ld}",
    118 +		(unsigned long long)statbuf.f_bavail,
    119 +		(unsigned long long)statbuf.f_files,
    120 +		(unsigned long long)statbuf.f_ffree,
    121 +		statbuf.f_fsid.val[0], statbuf.f_fsid.val[1]);
    122 +#else
    123  	tprintf("f_bavail=%llu, f_files=%llu, f_ffree=%llu, f_fsid={%d, %d}",
    124  		(unsigned long long)statbuf.f_bavail,
    125  		(unsigned long long)statbuf.f_files,
    126  		(unsigned long long)statbuf.f_ffree,
    127  		statbuf.f_fsid.__val[0], statbuf.f_fsid.__val[1]);
    128 +#endif
    129  	tprintf(", f_namelen=%lu", (unsigned long)statbuf.f_namelen);
    130  #ifdef _STATFS_F_FRSIZE
    131  	tprintf(", f_frsize=%llu", (unsigned long long)statbuf.f_frsize);
    132 diff -r -u -d /tmp/strace-4.6/ioctl.c ./ioctl.c
    133 --- /tmp/strace-4.6/ioctl.c	2011-01-15 12:15:31.000000000 -0800
    134 +++ ./ioctl.c	2013-01-04 12:26:34.977221825 -0800
    135 @@ -155,9 +155,11 @@
    136  	case 0x03:
    137  	case 0x12:
    138  		return block_ioctl(tcp, code, arg);
    139 +#ifndef HAVE_ANDROID_OS
    140  	case 0x22:
    141  		return scsi_ioctl(tcp, code, arg);
    142  #endif
    143 +#endif
    144  	default:
    145  		break;
    146  	}
    147 diff -r -u -d /tmp/strace-4.6/ipc.c ./ipc.c
    148 --- /tmp/strace-4.6/ipc.c	2010-03-31 15:22:01.000000000 -0700
    149 +++ ./ipc.c	2013-01-04 12:26:34.977221825 -0800
    150 @@ -40,9 +40,15 @@
    151  
    152  #include <fcntl.h>
    153  #include <sys/ipc.h>
    154 +#ifdef HAVE_ANDROID_OS
    155 +#include <linux/sem.h>
    156 +#include <linux/msg.h>
    157 +#include <linux/shm.h>
    158 +#else
    159  #include <sys/sem.h>
    160  #include <sys/msg.h>
    161  #include <sys/shm.h>
    162 +#endif
    163  
    164  #ifndef MSG_STAT
    165  #define MSG_STAT 11
    166 diff -r -u -d /tmp/strace-4.6/process.c ./process.c
    167 --- /tmp/strace-4.6/process.c	2011-03-14 14:58:59.000000000 -0700
    168 +++ ./process.c	2013-01-04 12:26:34.987221830 -0800
    169 @@ -45,7 +45,11 @@
    170  #include <sys/wait.h>
    171  #include <sys/resource.h>
    172  #include <sys/utsname.h>
    173 +#ifdef HAVE_ANDROID_OS
    174 +#include <asm/user.h>
    175 +#else
    176  #include <sys/user.h>
    177 +#endif
    178  #include <sys/syscall.h>
    179  #include <signal.h>
    180  #ifdef SUNOS4
    181 @@ -114,6 +118,10 @@
    182  #define GETGROUPS32_T __kernel_gid32_t
    183  #endif /* LINUX */
    184  
    185 +#ifdef HAVE_ANDROID_OS
    186 +#define __sched_priority sched_priority
    187 +#endif
    188 +
    189  #if defined(LINUX) && defined(IA64)
    190  # include <asm/ptrace_offsets.h>
    191  # include <asm/rse.h>
    192 diff -r -u -d /tmp/strace-4.6/signal.c ./signal.c
    193 --- /tmp/strace-4.6/signal.c	2011-03-10 15:14:47.000000000 -0800
    194 +++ ./signal.c	2013-01-04 12:26:34.987221830 -0800
    195 @@ -37,9 +37,17 @@
    196  
    197  #include <stdint.h>
    198  #include <signal.h>
    199 +#ifndef HAVE_ANDROID_OS
    200  #include <sys/user.h>
    201 +#endif
    202  #include <fcntl.h>
    203  
    204 +#ifdef HAVE_ANDROID_OS
    205 +//FIXME use "sigprocmask" or something
    206 +#define sigmask(sig)    (1UL << ((sig) - 1))
    207 +#define sigcontext_struct sigcontext
    208 +#endif
    209 +
    210  #ifdef SVR4
    211  #include <sys/ucontext.h>
    212  #endif /* SVR4 */
    213 @@ -455,7 +463,7 @@
    214  
    215  #endif /* LINUX */
    216  
    217 -#if __GLIBC_MINOR__ < 1
    218 +#if __GLIBC_MINOR__ < 1 && !defined(HAVE_ANDROID_OS)
    219  /* Type for data associated with a signal.  */
    220  typedef union sigval
    221  {
    222 @@ -1492,6 +1500,7 @@
    223  		tcp->u_arg[0] = 0;
    224  		sp = regs.regs[29];
    225  		if (umove(tcp, sp, &si) < 0)
    226 +			return 0;
    227  		tcp->u_arg[0] = 1;
    228  		tcp->u_arg[1] = si.si_mask;
    229  	} else {
    230 diff -r -u -d /tmp/strace-4.6/syscall.c ./syscall.c
    231 --- /tmp/strace-4.6/syscall.c	2011-02-18 16:02:27.000000000 -0800
    232 +++ ./syscall.c	2013-03-21 17:57:17.999238040 -0700
    233 @@ -38,7 +38,9 @@
    234  #include <signal.h>
    235  #include <time.h>
    236  #include <errno.h>
    237 +#ifndef HAVE_ANDROID_OS
    238  #include <sys/user.h>
    239 +#endif
    240  #include <sys/syscall.h>
    241  #include <sys/param.h>
    242  
    243 @@ -2600,6 +2602,7 @@
    244  	}
    245  
    246  	switch (known_scno(tcp)) {
    247 +#ifndef __ARM_EABI__
    248  #ifdef SYS_socket_subcall
    249  	case SYS_socketcall:
    250  		decode_subcall(tcp, SYS_socket_subcall,
    251 @@ -2612,6 +2615,7 @@
    252  			SYS_ipc_nsubcalls, shift_style);
    253  		break;
    254  #endif
    255 +#endif
    256  #ifdef SVR4
    257  #ifdef SYS_pgrpsys_subcall
    258  	case SYS_pgrpsys:
    259 diff -r -u -d /tmp/strace-4.6/system.c ./system.c
    260 --- /tmp/strace-4.6/system.c	2011-02-22 02:22:13.000000000 -0800
    261 +++ ./system.c	2013-03-21 17:27:34.050083824 -0700
    262 @@ -32,6 +32,11 @@
    263  
    264  #include "defs.h"
    265  
    266 +#ifdef HAVE_ANDROID_OS
    267 +#undef __unused
    268 +#include <linux/socket.h>
    269 +#endif
    270 +
    271  #ifdef LINUX
    272  #define _LINUX_SOCKET_H
    273  #define _LINUX_FS_H
    274 @@ -83,7 +88,7 @@
    275  #include <linux/utsname.h>
    276  #endif
    277  
    278 -#ifdef HAVE_ASM_SYSMIPS_H
    279 +#ifdef MIPS
    280  #include <asm/sysmips.h>
    281  #endif
    282  
    283 diff -r -u -d /tmp/strace-4.6/time.c ./time.c
    284 --- /tmp/strace-4.6/time.c	2011-03-03 18:08:02.000000000 -0800
    285 +++ ./time.c	2013-01-04 12:26:34.987221830 -0800
    286 @@ -33,7 +33,11 @@
    287  
    288  #ifdef LINUX
    289  #include <linux/version.h>
    290 +#ifdef HAVE_ANDROID_OS
    291 +#include <linux/timex.h>
    292 +#else
    293  #include <sys/timex.h>
    294 +#endif
    295  #include <linux/ioctl.h>
    296  #include <linux/rtc.h>
    297  
    298 diff -r -u -d /tmp/strace-4.6/util.c ./util.c
    299 --- /tmp/strace-4.6/util.c	2011-03-03 18:08:02.000000000 -0800
    300 +++ ./util.c	2013-03-21 17:57:25.519150107 -0700
    301 @@ -37,7 +37,9 @@
    302  
    303  #include <signal.h>
    304  #include <sys/syscall.h>
    305 +#ifndef HAVE_ANDROID_OS
    306  #include <sys/user.h>
    307 +#endif
    308  #include <sys/param.h>
    309  #include <fcntl.h>
    310  #if HAVE_SYS_UIO_H
    311