1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../dietlibc/pselect.patch
5 # Copyright (C) 2011 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 The emulation via legacy syscalls fails atomic tests, ...
19 - Rene Rebe <rene@exactcode.de>
21 --- dietlibc-0.32-vanilla/lib/pselect.c 2004-05-17 17:44:56.000000000 +0000
22 +++ dietlibc-0.32/lib/pselect.c 2011-01-09 18:17:03.314803895 +0000
24 #include <sys/select.h>
26 -int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
27 - const struct timespec *timeout, const sigset_t *sigmask) {
32 - t.tv_sec=timeout->tv_sec;
33 - t.tv_usec=timeout->tv_nsec/1000;
34 - if (!t.tv_sec && !t.tv_usec && timeout->tv_nsec) ++t.tv_usec;
37 - sigprocmask(SIG_SETMASK,sigmask,&old);
38 - r=select(n,readfds,writefds,exceptfds,
41 - sigprocmask(SIG_SETMASK,&old,0);
43 +int __pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
44 + const struct timespec *timeout, void* proxy);
45 +int __libc_pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
46 + const struct timespec *timeout, const sigset_t *sigmask) {
48 + const sigset_t *sigmask;
50 + } proxy = {sigmask, _NSIG/8};
52 + return __pselect(n,readfds,writefds,exceptfds, timeout, &proxy);
55 +int pselect(int n, fd_set* readfds, fd_set* writefds, fd_set* exceptfds,
56 + const struct timespec *timeout, const sigset_t *sigmask)
57 +__attribute__((weak,alias("__libc_pselect")));
58 diff -urN dietlibc-0.32-vanilla/syscalls.s/__pselect.S dietlibc-0.32/syscalls.s/__pselect.S
59 --- dietlibc-0.32-vanilla/syscalls.s/__pselect.S 1970-01-01 00:00:00.000000000 +0000
60 +++ dietlibc-0.32/syscalls.s/__pselect.S 2011-01-09 18:04:11.126794569 +0000
62 +#include "syscalls.h"
64 +syscall(pselect6,__pselect)