[git commit future] epoll: redo cancellation to match master

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Sat May 14 19:03:51 UTC 2011


I think you don't want that in future but keep the cancel.h impl.
On May 14, 2011 1:59 AM, "Bernhard Reutner-Fischer" <rep.dot.nop at gmail.com>
wrote:
>
> commit:
http://git.uclibc.org/uClibc/commit/?id=1bfe83b42b5b850c20ed8d35819cced510eaef3c
> branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
>
> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
> ---
> libc/sysdeps/linux/common/epoll.c | 47
+++++++++++++++++++++++++-----------
> 1 files changed, 32 insertions(+), 15 deletions(-)
>
> diff --git a/libc/sysdeps/linux/common/epoll.c
b/libc/sysdeps/linux/common/epoll.c
> index e3cbb00..85b0cfd 100644
> --- a/libc/sysdeps/linux/common/epoll.c
> +++ b/libc/sysdeps/linux/common/epoll.c
> @@ -9,7 +9,11 @@
>
> #include <sys/syscall.h>
> #include <sys/epoll.h>
> -#include <cancel.h>
> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__
> +# include <sysdep-cancel.h>
> +#else
> +# define SINGLE_THREAD_P 1
> +#endif
>
> /*
> * epoll_create()
> @@ -36,12 +40,21 @@ _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd,
struct epoll_event *, even
> * epoll_wait()
> */
> #ifdef __NR_epoll_wait
> -static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int
maxevents, int timeout)
> +extern __typeof(epoll_wait) __libc_epoll_wait;
> +int __libc_epoll_wait(int epfd, struct epoll_event *events, int
maxevents, int timeout)
> {
> - return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
> + if (SINGLE_THREAD_P)
> + return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout);
> +# ifdef __UCLIBC_HAS_THREADS_NATIVE__
> + else {
> + int oldtype = LIBC_CANCEL_ASYNC ();
> + int result = INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents,
timeout);
> + LIBC_CANCEL_RESET (oldtype);
> + return result;
> + }
> +# endif
> }
> -CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event
*events, int maxevents, int timeout),
> - (epfd, events, maxevents, timeout))
> +weak_alias(__libc_epoll_wait, epoll_wait)
> #endif
>
> /*
> @@ -50,16 +63,20 @@ CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct
epoll_event *events, int
> #ifdef __NR_epoll_pwait
> # include <signal.h>
>
> -# define __NR___syscall_epoll_pwait __NR_epoll_pwait
> -static __always_inline _syscall6(int, __syscall_epoll_pwait, int, epfd,
struct epoll_event *, events,
> - int, maxevents, int, timeout, const sigset_t *, sigmask, size_t,
sigsetsize)
> -
> -static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int
maxevents, int timeout,
> - const sigset_t *set)
> +extern __typeof(epoll_pwait) __libc_epoll_pwait;
> +int __libc_epoll_pwait(int epfd, struct epoll_event *events, int
maxevents,
> + int timeout, const sigset_t *set)
> {
> - return __syscall_epoll_pwait(epfd, events, maxevents, timeout, set,
__SYSCALL_SIGSET_T_SIZE);
> + if (SINGLE_THREAD_P)
> + return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout,
set, _NSIG / 8);
> +# ifdef __UCLIBC_HAS_THREADS_NATIVE__
> + else {
> + int oldtype = LIBC_CANCEL_ASYNC ();
> + int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents,
timeout, set, _NSIG / 8);
> + LIBC_CANCEL_RESET (oldtype);
> + return result;
> + }
> +# endif
> }
> -CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event
*events, int maxevents, int timeout,
> - const sigset_t *set),
> - (epfd, events, maxevents, timeout, set))
> +weak_alias(__libc_epoll_pwait, epoll_pwait)
> #endif
> --
> 1.7.3.4
>
> _______________________________________________
> uClibc-cvs mailing list
> uClibc-cvs at uclibc.org
> http://lists.busybox.net/mailman/listinfo/uclibc-cvs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/uclibc-cvs/attachments/20110514/b3fe29bb/attachment.html>


More information about the uClibc-cvs mailing list