Changes: *) Make pth_poll(3) more compliant to POSIX.1-2001/SUSv3 poll(2). *) Make pth_select(3) more compliant to POSIX.1-2001/SUSv3 select(2). *) Replaced pth_event_occurred() with pth_event_status(). *) Add Autoconf option --with-fdsetsize=NUM for enlarging FD_SETSIZE. *) Added thread attribute PTH_ATTR_DISPATCHES. *) Added sub-API pth_uctx_* for user-space context switching. *) Add a Pth variant of the new POSIX pselect(2) function. *) Internally cleaned up the error handling macros. *) Added POSIX-compliant sanity checks for bad fds. *) Added pth_nanosleep() function. *) Allow a NULL name for pth_msgport_create() *) Completely rewrote the "hard syscall mapping". *) Added support to pth_poll(3) for POLLD{RD,WR}{NORM,BAND}. *) Fixed a long-standing termination bug in pth_exit(3). *) Upgraded to Autoconf 2.57, Shtool 1.6.2 and Libtool 1.4.3. *) Add optional support for OSSP ex based exception handling.
30 lines
685 B
Text
30 lines
685 B
Text
$NetBSD: patch-aj,v 1.2 2003/05/02 11:49:49 wiz Exp $
|
|
|
|
--- pth_util.c.orig Wed Jan 1 15:45:06 2003
|
|
+++ pth_util.c
|
|
@@ -182,3 +182,25 @@ intern int pth_util_fds_select(int nfd,
|
|
return n;
|
|
}
|
|
|
|
+/*
|
|
+ * zero the first 'nfd' file descriptors in an fd_set.
|
|
+ */
|
|
+intern void pth_util_fd_zero(int nfd, fd_set *fds)
|
|
+{
|
|
+ int i;
|
|
+ for (i=0; i<nfd; i++)
|
|
+ FD_CLR(i, fds);
|
|
+}
|
|
+
|
|
+/*
|
|
+ * copy the first 'nfd' file descriptors from one fd_set to another.
|
|
+ */
|
|
+intern void pth_util_fd_copy(int nfd, fd_set* dfds, fd_set* sfds)
|
|
+{
|
|
+ int i;
|
|
+ for (i=0; i < nfd; i++)
|
|
+ if (FD_ISSET(i, sfds))
|
|
+ FD_SET(i, dfds);
|
|
+ else
|
|
+ FD_CLR(i, dfds);
|
|
+}
|