aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-04-19 08:32:59 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-04-19 08:32:59 +0000
commitd02099f2396a189ec56227b554b396178013d0b8 (patch)
tree648b2d1c00a6273096e8bfb2945df1e75a9c71a6 /winsup
parent3b4ed14c7cabd6362c6a4c923dc2bc4810b450ad (diff)
downloadnewlib-d02099f2396a189ec56227b554b396178013d0b8.zip
newlib-d02099f2396a189ec56227b554b396178013d0b8.tar.gz
newlib-d02099f2396a189ec56227b554b396178013d0b8.tar.bz2
* cygwin.din (pselect): Export.
* select.cc (pselect): New function. * include/cygwin/version.h: Bump API minor number. * include/sys/select.h: Include signal.h. Declare pselect.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/cygwin.din1
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/include/sys/select.h6
-rw-r--r--winsup/cygwin/select.cc28
5 files changed, 44 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a1f575a..c5b5e69 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-19 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygwin.din (pselect): Export.
+ * select.cc (pselect): New function.
+ * include/cygwin/version.h: Bump API minor number.
+ * include/sys/select.h: Include signal.h. Declare pselect.
+
2005-04-18 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (enum conn_state): Add connect_failed state.
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index a269d93..1bf6635 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -346,6 +346,7 @@ rexec = cygwin_rexec SIGFE
rresvport = cygwin_rresvport SIGFE
_select = cygwin_select SIGFE
select = cygwin_select SIGFE
+pselect SIGFE
send = cygwin_send SIGFE
sendmsg = cygwin_sendmsg SIGFE
sendto = cygwin_sendto SIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index f75f09c..ddb0de0 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -254,12 +254,13 @@ details. */
125: LD_PRELOAD/CW_HOOK available.
126: Export lsearch, lfind, timer_gettime.
127: Export sigrelese.
+ 128: Export pselect.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 127
+#define CYGWIN_VERSION_API_MINOR 128
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/include/sys/select.h b/winsup/cygwin/include/sys/select.h
index 666a151..b0f3283 100644
--- a/winsup/cygwin/include/sys/select.h
+++ b/winsup/cygwin/include/sys/select.h
@@ -23,10 +23,16 @@ details. */
#include <sys/time.h>
#include <time.h>
+/* Get definition of sigset_t. */
+#include <signal.h>
+
__BEGIN_DECLS
int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
fd_set *__exceptfds, struct timeval *__timeout));
+int pselect __P ((int __n, fd_set *__readfds, fd_set *__writefds,
+ fd_set *__exceptfds, const struct timespec *__timeout,
+ const sigset_t *__set));
__END_DECLS
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 2daa88a..4abc249 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -36,6 +36,7 @@ details. */
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
+#include "pinfo.h"
#include "sigproc.h"
#include "tty.h"
#include "ntdll.h"
@@ -158,6 +159,33 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
return timeout ? 0 : sel.poll (readfds, writefds, exceptfds);
}
+extern "C" int
+pselect(int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+ const struct timespec *ts, const sigset_t *set)
+{
+ struct timeval tv;
+ sigset_t oldset = myself->getsigmask ();
+
+ if (ts)
+ {
+ if (check_invalid_read_struct_errno (ts))
+ return -1;
+ tv.tv_sec = ts->tv_sec;
+ tv.tv_usec = ts->tv_nsec / 1000;
+ }
+ if (set)
+ {
+ if (check_invalid_read_struct_errno (set))
+ return -1;
+ set_signal_mask (*set);
+ }
+ int ret = cygwin_select (maxfds, readfds, writefds, exceptfds,
+ ts ? &tv : NULL);
+ if (set)
+ set_signal_mask (oldset);
+ return ret;
+}
+
/* Call cleanup functions for all inspected fds. Gets rid of any
executing threads. */
void