From mboxrd@z Thu Jan 1 00:00:00 1970 From: c.briere@samsung.com (Charles Briere) Date: Mon, 27 Oct 2014 20:49:30 +0000 Subject: [lttng-dev] [PATCH lttng-tools 23/24] Android : Define posix_fadvise In-Reply-To: <1414442926-14381-1-git-send-email-c.briere@samsung.com> References: <1414442926-14381-1-git-send-email-c.briere@samsung.com> Message-ID: <1414442926-14381-24-git-send-email-c.briere@samsung.com> From: Charles Briere Mapping from __NR_arm_fadvise64_64 to posix_fadvise is not done within BIONIC Signed-off-by: Charles Briere --- configure.ac | 1 + src/common/compat/fcntl.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 91efd17..ea37ad0 100644 --- a/configure.ac +++ b/configure.ac @@ -67,6 +67,7 @@ AC_CHECK_TYPES([in_port_t], [], [], [[#include ]]) AC_CHECK_DECLS([sigwaitinfo],[],[], [[#include ]]) AC_CHECK_DECLS([pthread_cancel], [], [], [[#include ]]) +AC_CHECK_DECLS([posix_fadvise],[],[], [[#include ]]) AC_CHECK_FUNCS([getpwuid_r],[],[]) diff --git a/src/common/compat/fcntl.h b/src/common/compat/fcntl.h index 1325a3f..779c942 100644 --- a/src/common/compat/fcntl.h +++ b/src/common/compat/fcntl.h @@ -36,6 +36,12 @@ extern int compat_sync_file_range(int fd, off64_t offset, off64_t nbytes, #define lttng_sync_file_range(fd, offset, nbytes, flags) \ compat_sync_file_range(fd, offset, nbytes, flags) +# if !HAVE_DECL_POSIX_FADVISE +# if defined(__NR_arm_fadvise64_64) +# define posix_fadvise(fd, offset, len, advise) syscall(__NR_arm_fadvise64_64, fd, offset, len, advise) +# endif +# endif + # ifndef POSIX_FADV_DONTNEED # include # endif -- 2.1.2