* select.cc (pselect): New function.
* include/cygwin/version.h: Bump API minor number.
* include/sys/select.h: Include signal.h. Declare pselect.
+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.
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
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
#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
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
+#include "pinfo.h"
#include "sigproc.h"
#include "tty.h"
#include "ntdll.h"
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