disable read sync mode
Read sync mode "O_RSYNC" is not supported in Android.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/src/current/iozone.c b/src/current/iozone.c
index 38f9da8..5d7a98f 100644
--- a/src/current/iozone.c
+++ b/src/current/iozone.c
@@ -2485,8 +2485,12 @@
break;
#if defined(_HPUX_SOURCE) || defined(linux) || defined(solaris)
case 'r': /* Read sync too */
+#if ! defined(__Android__)
read_sync=1;
sprintf(splash[splash_line++],"\tRead & Write sync mode active.\n");
+#else
+ sprintf(splash[splash_line++],"\tRead sync mode is not supported in Android.\n");
+#endif
break;
#endif
#ifndef NO_MADVISE
@@ -7342,10 +7346,12 @@
if(odsync)
file_flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux) || defined(__FreeBSD__) || defined(__DragonFly__)
if(read_sync)
file_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -8326,10 +8332,12 @@
numrecs64 = (kilo64*1024)/reclen;
open_flags = O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
open_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
if(direct_flag)
@@ -8898,10 +8906,12 @@
if(odsync)
flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
filebytes64 = numrecs64*reclen;
for( j=0; j<2; j++ )
{
@@ -9363,10 +9373,12 @@
open_flags |=O_DIRECTIO;
#endif
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
open_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
numrecs64 = (kilo64*1024)/reclen;
filebytes64 = numrecs64*reclen;
fd = 0;
@@ -9665,10 +9677,12 @@
if(odsync)
flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
/*
if (!no_unlink)
{
@@ -9975,10 +9989,12 @@
open_flags |=O_DIRECTIO;
#endif
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
open_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
next64 = (off64_t)0;
numrecs64 = (kilos64*1024)/reclen;
filebytes64 = numrecs64*reclen;
@@ -10300,10 +10316,12 @@
flags_here |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags_here |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -10564,10 +10582,12 @@
open_flags |=O_DIRECTIO;
#endif
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux) || defined(__FreeBSD__) || defined(__DragonFly__)
if(read_sync)
open_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
if(r_traj_flag)
{
filebytes64 = r_traj_fsize;
@@ -10811,10 +10831,12 @@
if(odsync)
flags_here |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags_here |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -11149,10 +11171,12 @@
open_flags |=O_DIRECTIO;
#endif
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
open_flags |=O_RSYNC|O_SYNC;
#endif
+#endif
numrecs64 = (kilos64*1024)/reclen;
filebytes64 = numrecs64*reclen;
nbuff = mainbuffer;
@@ -12473,10 +12497,12 @@
if(odsync)
flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -13172,10 +13198,12 @@
if(odsync)
flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -13782,10 +13810,12 @@
if(odsync)
flags|= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -14347,10 +14377,12 @@
flags=O_RDONLY|O_SYNC;
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -14922,10 +14954,12 @@
flags=O_RDONLY|O_SYNC;
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -15473,10 +15507,12 @@
flags=O_RDONLY|O_SYNC;
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -16038,10 +16074,12 @@
flags=O_RDONLY|O_SYNC;
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -16571,10 +16609,12 @@
flags=O_RDONLY|O_SYNC;
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
if(direct_flag)
@@ -17224,10 +17264,12 @@
}
else
flags=O_RDONLY;
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
@@ -17876,10 +17918,12 @@
if(odsync)
flags |= O_DSYNC;
#endif
+#if ! defined(__Android__)
#if defined(_HPUX_SOURCE) || defined(linux)
if(read_sync)
flags |=O_RSYNC|O_SYNC;
#endif
+#endif
#if ! defined(DONT_HAVE_O_DIRECT)
#if defined(linux) || defined(__AIX__) || defined(IRIX) || defined(IRIX64) || defined(Windows) || defined (__FreeBSD__)
diff --git a/src/current/libbif.c b/src/current/libbif.c
index ee2cf24..d7cf485 100644
--- a/src/current/libbif.c
+++ b/src/current/libbif.c
@@ -17,7 +17,7 @@
#include <sys/types.h>
#include <stdio.h>
#include <sys/file.h>
-#if defined(__AIX__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__AIX__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__Android__)
#include <fcntl.h>
#else
#include <sys/fcntl.h>