# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../dietlibc/pselect.patch # Copyright (C) 2011 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- The emulation via legacy syscalls fails atomic tests, ... - Rene Rebe --- dietlibc-0.32-vanilla/lib/pselect.c 2004-05-17 17:44:56.000000000 +0000 +++ dietlibc-0.32/lib/pselect.c 2011-01-09 18:17:03.314803895 +0000 @@ -1,20 +1,17 @@ #include -int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, - const struct timespec *timeout, const sigset_t *sigmask) { - struct timeval t; - sigset_t old; - int r; - if (timeout) { - t.tv_sec=timeout->tv_sec; - t.tv_usec=timeout->tv_nsec/1000; - if (!t.tv_sec && !t.tv_usec && timeout->tv_nsec) ++t.tv_usec; - } - if (sigmask) - sigprocmask(SIG_SETMASK,sigmask,&old); - r=select(n,readfds,writefds,exceptfds, - timeout?&t:0); - if (sigmask) - sigprocmask(SIG_SETMASK,&old,0); - return r; +int __pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, + const struct timespec *timeout, void* proxy); +int __libc_pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, + const struct timespec *timeout, const sigset_t *sigmask) { + struct { + const sigset_t *sigmask; + size_t nr; + } proxy = {sigmask, _NSIG/8}; + + return __pselect(n,readfds,writefds,exceptfds, timeout, &proxy); } + +int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, + const struct timespec *timeout, const sigset_t *sigmask) +__attribute__((weak,alias("__libc_pselect"))); diff -urN dietlibc-0.32-vanilla/syscalls.s/__pselect.S dietlibc-0.32/syscalls.s/__pselect.S --- dietlibc-0.32-vanilla/syscalls.s/__pselect.S 1970-01-01 00:00:00.000000000 +0000 +++ dietlibc-0.32/syscalls.s/__pselect.S 2011-01-09 18:04:11.126794569 +0000 @@ -0,0 +1,3 @@ +#include "syscalls.h" + +syscall(pselect6,__pselect)