Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-04-18 16:00:05 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-04-18 16:00:05 +0400
commit20a0b8c8e6bd0ac540e5545de1d8185de01fd8bb (patch)
tree3409c50beb83b8aeadb4a4d9fca4f13939360aa6 /winsup
parent0077cd1016c8414f6175f8e94f97be9ea4506bea (diff)
* cygwin.din (ppoll): Export.
* poll.cc (ppoll): Implement. * posix.sgml (std-gnu): Add ppoll. * include/cygwin/version.h: Bump API minor number. * include/sys/poll.h (ppoll): Declare.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/cygwin.din1
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/include/sys/poll.h6
-rw-r--r--winsup/cygwin/poll.cc23
-rw-r--r--winsup/cygwin/posix.sgml1
6 files changed, 40 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 83d332020..1bb3d0ffd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2011-04-18 Corinna Vinschen <corinna@vinschen.de>
+ * cygwin.din (ppoll): Export.
+ * poll.cc (ppoll): Implement.
+ * posix.sgml (std-gnu): Add ppoll.
+ * include/cygwin/version.h: Bump API minor number.
+ * include/sys/poll.h (ppoll): Declare.
+
+2011-04-18 Corinna Vinschen <corinna@vinschen.de>
+
* fhandler_socket.cc (fhandler_socket::evaluate_events): Handle the
FD_CLOSE event specially when called from accept. Explain why.
(fhandler_socket::shutdown): Fake success on not-connected socket and
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index d5edb2052..823776d60 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -1160,6 +1160,7 @@ pow10 NOSIGFE
pow10f NOSIGFE
powf NOSIGFE
_powf = powf NOSIGFE
+ppoll SIGFE
pread SIGFE
printf SIGFE
program_invocation_name DATA
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 072f62dcd..95e5876da 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -404,12 +404,13 @@ details. */
238: Export pthread_spin_destroy, pthread_spin_init, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock.
239: Export pthread_setschedprio.
+ 240: Export ppoll.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 239
+#define CYGWIN_VERSION_API_MINOR 240
/* 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/poll.h b/winsup/cygwin/include/sys/poll.h
index 7fd1c6eb0..a9d228b63 100644
--- a/winsup/cygwin/include/sys/poll.h
+++ b/winsup/cygwin/include/sys/poll.h
@@ -1,6 +1,6 @@
/* sys/poll.h
- Copyright 2000, 2001, 2006 Red Hat, Inc.
+ Copyright 2000, 2001, 2006, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -12,6 +12,7 @@
#define _SYS_POLL_H
#include <sys/cdefs.h>
+#include <sys/types.h>
__BEGIN_DECLS
@@ -39,6 +40,9 @@ struct pollfd {
typedef unsigned int nfds_t;
extern int poll __P ((struct pollfd *fds, nfds_t nfds, int timeout));
+extern int ppoll __P ((struct pollfd *fds, nfds_t nfds,
+ const struct timespec *timeout_ts,
+ const sigset_t *sigmask));
__END_DECLS
diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc
index 2e68f3249..3c342adfd 100644
--- a/winsup/cygwin/poll.cc
+++ b/winsup/cygwin/poll.cc
@@ -21,6 +21,8 @@
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
+#include "pinfo.h"
+#include "sigproc.h"
extern "C" int
poll (struct pollfd *fds, nfds_t nfds, int timeout)
@@ -124,3 +126,24 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout)
return ret;
}
+
+extern "C" int
+ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts,
+ const sigset_t *sigmask)
+{
+ int timeout;
+ sigset_t oldset = _my_tls.sigmask;
+
+ myfault efault;
+ if (efault.faulted (EFAULT))
+ return -1;
+ timeout = (timeout_ts == NULL)
+ ? -1
+ : (timeout_ts->tv_sec * 1000 + timeout_ts->tv_nsec / 1000000);
+ if (sigmask)
+ set_signal_mask (*sigmask, _my_tls.sigmask);
+ int ret = poll (fds, nfds, timeout);
+ if (sigmask)
+ set_signal_mask (oldset, _my_tls.sigmask);
+ return ret;
+}
diff --git a/winsup/cygwin/posix.sgml b/winsup/cygwin/posix.sgml
index d44f2bfd5..47cbcab6f 100644
--- a/winsup/cygwin/posix.sgml
+++ b/winsup/cygwin/posix.sgml
@@ -1116,6 +1116,7 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).</para>
pipe2
pow10
pow10f
+ ppoll
removexattr
setxattr
strchrnul