diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-24 02:58:45 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-08-24 02:58:45 +0000 |
commit | 01f422c12f5799a44832eb26967a906edfc2ba55 (patch) | |
tree | 1e8bdcaab1f4da088cc1c490bf96c361a663e0c4 /libc/sysdeps/linux/common/pselect.c | |
parent | d2db9bdb4c79afcd4b09353346cd4eaf63b6cd2c (diff) | |
download | uClibc-alpine-01f422c12f5799a44832eb26967a906edfc2ba55.tar.bz2 uClibc-alpine-01f422c12f5799a44832eb26967a906edfc2ba55.tar.xz |
Well, this is everything for my NPTL implementation. The 'uClibc-nptl' branch is now the exact code that I have. I am going to re-run tests now to verify everything one more time. The next step after that is to merge from trunk with the latest stuff from Mike and Peter.
Diffstat (limited to 'libc/sysdeps/linux/common/pselect.c')
-rw-r--r-- | libc/sysdeps/linux/common/pselect.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/pselect.c b/libc/sysdeps/linux/common/pselect.c index 93a85a622..7e93537dd 100644 --- a/libc/sysdeps/linux/common/pselect.c +++ b/libc/sysdeps/linux/common/pselect.c @@ -22,6 +22,9 @@ #include <stddef.h> /* For NULL. */ #include <sys/time.h> #include <sys/select.h> +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +#include <sysdep-cancel.h> +#endif libc_hidden_proto(sigprocmask) libc_hidden_proto(select) @@ -33,8 +36,13 @@ libc_hidden_proto(select) after waiting the interval specified therein. Additionally set the sigmask SIGMASK for this call. Returns the number of ready descriptors, or -1 for errors. */ +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +static int +__pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, +#else int pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, +#endif const struct timespec *timeout, const sigset_t *sigmask) { struct timeval tval; @@ -64,3 +72,23 @@ pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, return retval; } + +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +int +pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, + const struct timespec *timeout, const sigset_t *sigmask) +{ + if (SINGLE_THREAD_P) + return __pselect (nfds, readfds, writefds, exceptfds, + timeout, sigmask); + + int oldtype = LIBC_CANCEL_ASYNC (); + + int result = __pselect (nfds, readfds, writefds, exceptfds, + timeout, sigmask); + + LIBC_CANCEL_RESET (oldtype); + + return result; +} +#endif |