OSSP CVS Repository

ossp - Difference in ossp-pkg/pth/pth_high.c versions 1.92 and 1.93
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/pth/pth_high.c 1.92 -> 1.93

--- pth_high.c   2002/10/25 11:53:28     1.92
+++ pth_high.c   2002/10/25 11:56:16     1.93
@@ -414,6 +414,38 @@
     return rc;
 }
 
+/* Pth variant of pth_pselect(2) */
+int pth_pselect(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
+                const struct timespec *ts, const sigset_t *mask)
+{
+    sigset_t omask;
+    struct timeval tv;
+    struct timeval *tvp;
+    int rv;
+
+    /* convert timeout */
+    if (ts != NULL) {
+        tv.tv_sec  = ts->tv_sec;
+        tv.tv_usec = ts->tv_nsec / 1000;
+        tvp = &tv;
+    }
+    else
+        tvp = NULL;
+
+    /* optionally set signal mask */
+    if (mask != NULL)
+        if (pth_sc(sigprocmask)(SIG_SETMASK, mask, &omask) < 0)
+            return pth_error(-1, errno);
+
+    rv = pth_select(nfds, rfds, wfds, efds, tvp);
+
+    /* optionally set signal mask */
+    if (mask != NULL)
+        pth_shield { pth_sc(sigprocmask)(SIG_SETMASK, &omask, NULL); }
+
+    return rv;
+}
+
 /* Pth variant of poll(2) */
 int pth_poll(struct pollfd *pfd, nfds_t nfd, int timeout)
 {

CVSTrac 2.0.1