<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>OK. All merged with minor edits.<br></div><div><br></div><div>Thanks,<br></div><div><br></div><div>Mathieu<br></div><div><br></div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Charles Brière" <charlesbriere.flatzo@gmail.com><br><b>To: </b>"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com><br><b>Cc: </b>lttng-dev@lists.lttng.org, "Pierre-Luc St-Charles" <pierre-luc.st-charles@polymtl.ca><br><b>Sent: </b>Wednesday, November 27, 2013 12:20:59 PM<br><b>Subject: </b>Re: [PATCH liburcu 3/5] Added a compat layer for 'syscall.h'<br><div><br></div><div dir="ltr">I can't recall the reason as this is a rebase from a patch from long ago, but changing it back to __linux__ doesn't affect at all compilation on Android and this line in the patch can be discarded. <div>
<br></div><div>Sorry about that,</div><div>Charles<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div><br></div><div class="gmail_quote">On Wed, Nov 27, 2013 at 8:29 AM, Mathieu Desnoyers <span dir="ltr"><<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">----- Original Message -----<br>
> From: "Charles Briere" <<a href="mailto:charlesbriere.flatzo@gmail.com" target="_blank">charlesbriere.flatzo@gmail.com</a>><br>
> To: "mathieu desnoyers" <<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>><br>
> Cc: <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a>, "Pierre-Luc St-Charles" <<a href="mailto:pierre-luc.st-charles@polymtl.ca" target="_blank">pierre-luc.st-charles@polymtl.ca</a>>, "Charles Briere"<br>

> <<a href="mailto:charlesbriere.flatzo@gmail.com" target="_blank">charlesbriere.flatzo@gmail.com</a>><br>
> Sent: Wednesday, November 27, 2013 10:48:31 AM<br>
> Subject: [PATCH liburcu 3/5] Added a compat layer for 'syscall.h'<br>
><br>
> From: Pierre-Luc St-Charles <<a href="mailto:pierre-luc.st-charles@polymtl.ca" target="_blank">pierre-luc.st-charles@polymtl.ca</a>><br>
><br>
> Path to include syscall.h is different on Android<br>
><br>
> Signed-off-by: Charles Briere <<a href="mailto:charlesbriere.flatzo@gmail.com" target="_blank">charlesbriere.flatzo@gmail.com</a>><br>
> ---<br>
>  Makefile.am              |  2 +-<br>
>  tests/common/thread-id.h |  5 ++---<br>
>  urcu.c                   |  2 +-<br>
>  urcu/futex.h             |  2 +-<br>
>  urcu/syscall-compat.h    | 36 ++++++++++++++++++++++++++++++++++++<br>
>  5 files changed, 41 insertions(+), 6 deletions(-)<br>
>  create mode 100644 urcu/syscall-compat.h<br>
><br>
> diff --git a/Makefile.am b/Makefile.am<br>
> index baac8b9..64073a1 100644<br>
> --- a/Makefile.am<br>
> +++ b/Makefile.am<br>
> @@ -20,7 +20,7 @@ nobase_dist_include_HEADERS = urcu/compiler.h urcu/hlist.h<br>
> urcu/list.h \<br>
>               urcu/wfqueue.h urcu/rculfstack.h urcu/rculfqueue.h \<br>
>               urcu/ref.h urcu/cds.h urcu/urcu_ref.h urcu/urcu-futex.h \<br>
>               urcu/uatomic_arch.h urcu/rculfhash.h urcu/wfcqueue.h \<br>
> -             urcu/lfstack.h \<br>
> +             urcu/lfstack.h urcu/syscall-compat.h \<br>
>               $(top_srcdir)/urcu/map/*.h \<br>
>               $(top_srcdir)/urcu/static/*.h \<br>
>               urcu/tls-compat.h<br>
> diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h<br>
> index 9378edc..bad3006 100644<br>
> --- a/tests/common/thread-id.h<br>
> +++ b/tests/common/thread-id.h<br>
> @@ -17,9 +17,8 @@<br>
>   * provided the above notices are retained, and a notice that the code was<br>
>   * modified is included with the above copyright notice.<br>
>   */<br>
> -<br>
> -#ifdef __linux__<br>
> -# include <syscall.h><br>
> +#ifdef __Linux__<br>
<br>
</div></div>Changing from __linux__ to __Linux__ breaks things here on non-Android.<br>
Why are you changing this ?<br>
<br>
In file included from test_rwlock.c:39:0:<br>
../../tests/common/thread-id.h:46:3: warning: #warning "use pid as thread ID" [-Wcpp]<br>
<br>
Thanks,<br>
<br>
Mathieu<br>
<div class="HOEnZb"><div class="h5"><br>
> +# include <urcu/syscall-compat.h><br>
><br>
>  # if defined(_syscall0)<br>
>  _syscall0(pid_t, gettid)<br>
> diff --git a/urcu.c b/urcu.c<br>
> index 759b94b..69ebcaa 100644<br>
> --- a/urcu.c<br>
> +++ b/urcu.c<br>
> @@ -66,7 +66,7 @@<br>
>   * RCU_MEMBARRIER is only possibly available on Linux.<br>
>   */<br>
>  #if defined(RCU_MEMBARRIER) && defined(__linux__)<br>
> -#include <syscall.h><br>
> +#include <urcu/syscall-compat.h><br>
>  #endif<br>
><br>
>  /* If the headers do not support SYS_membarrier, fall back on RCU_MB */<br>
> diff --git a/urcu/futex.h b/urcu/futex.h<br>
> index cdaa430..bb270c2 100644<br>
> --- a/urcu/futex.h<br>
> +++ b/urcu/futex.h<br>
> @@ -45,7 +45,7 @@ extern "C" {<br>
>   */<br>
><br>
>  #ifdef CONFIG_RCU_HAVE_FUTEX<br>
> -#include <syscall.h><br>
> +#include <urcu/syscall-compat.h><br>
>  #define futex(...)   syscall(__NR_futex, __VA_ARGS__)<br>
>  #define futex_noasync(uaddr, op, val, timeout, uaddr2, val3) \<br>
>               futex(uaddr, op, val, timeout, uaddr2, val3)<br>
> diff --git a/urcu/syscall-compat.h b/urcu/syscall-compat.h<br>
> new file mode 100644<br>
> index 0000000..55576f0<br>
> --- /dev/null<br>
> +++ b/urcu/syscall-compat.h<br>
> @@ -0,0 +1,36 @@<br>
> +#ifndef _URCU_SYSCALL_COMPAT_H<br>
> +#define _URCU_SYSCALL_COMPAT_H<br>
> +<br>
> +/*<br>
> + * urcu/syscall-compat.h<br>
> + *<br>
> + * Userspace RCU library - Syscall Compatibility Header<br>
> + *<br>
> + * Copyright 2013 - Pierre-Luc St-Charles <<a href="mailto:pierre-luc.st-charles@polymtl.ca" target="_blank">pierre-luc.st-charles@polymtl.ca</a>><br>
> + *<br>
> + * Note: this file is only used to simplify the code required to<br>
> + * include the 'syscall.h' system header across multiple platforms,<br>
> + * which might not always be located at the same place (or needed at all).<br>
> + *<br>
> + * This library is free software; you can redistribute it and/or<br>
> + * modify it under the terms of the GNU Lesser General Public<br>
> + * License as published by the Free Software Foundation; either<br>
> + * version 2.1 of the License, or (at your option) any later version.<br>
> + *<br>
> + * This library is distributed in the hope that it will be useful,<br>
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU<br>
> + * Lesser General Public License for more details.<br>
> + *<br>
> + * You should have received a copy of the GNU Lesser General Public<br>
> + * License along with this library; if not, write to the Free Software<br>
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301<br>
> USA<br>
> + */<br>
> +<br>
> +#if defined(__ANDROID__)<br>
> +#include <sys/syscall.h><br>
> +#elif defined(__linux__)<br>
> +#include <syscall.h><br>
> +#endif<br>
> +<br>
> +#endif /* _URCU_SYSCALL_COMPAT_H */<br>
> --<br>
> 1.8.4.2<br>
><br>
><br>
<br>
</div></div><span class="HOEnZb"><span style="color: #888888;" data-mce-style="color: #888888;" color="#888888">--<br>
Mathieu Desnoyers<br>
EfficiOS Inc.<br>
<a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a><br>
</span></span></blockquote></div><br></div>
</blockquote><div><br><br></div><div><br></div><div>-- <br></div><div><span name="x"></span>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com<span name="x"></span><br></div></div></body></html>