Index: /trunk/include/iprt/poll.h
===================================================================
--- /trunk/include/iprt/poll.h	(revision 26755)
+++ /trunk/include/iprt/poll.h	(revision 26756)
@@ -56,13 +56,43 @@
  *
  * @returns IPRT status code.
- * @param   hPollSet        The set to poll on.
- * @param   cMillies        Number of milliseconds to wait.  Use
- *                          RT_INDEFINITE_WAIT to wait for ever.
- * @param   pfEvent         Where to return details about the events that
- *                          occured.  Optional.
- * @param   pid             Where to return the ID associated with the handle
- *                          when calling RTPollSetAdd.  Optional.
- */
-RTDECL(int) RTPoll(RTPIPE hPipe, RTMSINTERVAL cMillies, uint32_t *pfEvent, uint32_t *pid);
+ * @retval  VINF_SUCCESS if an event occured on a handle.  Note that these
+ * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
+ * @retval  VERR_TIMEOUT if @a cMillies ellapsed without any events.
+ * @retval  VERR_DEADLOCK if @a cMillies is set to RT_INDEFINITE_WAIT and there
+ *          are no valid handles in the set.
+ *
+ * @param   hPollSet            The set to poll on.
+ * @param   cMillies            Number of milliseconds to wait.  Use
+ *                              RT_INDEFINITE_WAIT to wait for ever.
+ * @param   pfEvents            Where to return details about the events that
+ *                              occured.  Optional.
+ * @param   pid                 Where to return the ID associated with the
+ *                              handle when calling RTPollSetAdd.  Optional.
+ *
+ * @sa      RTPollNoResume
+ */
+RTDECL(int) RTPoll(RTPOLLSET hPollSet, RTMSINTERVAL cMillies, uint32_t *pfEvents, uint32_t *pid);
+
+/**
+ * Same as RTPoll except that it will return when interrupted.
+ *
+ * @returns IPRT status code.
+ * @retval  VINF_SUCCESS if an event occured on a handle.  Note that these
+ * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
+ * @retval  VERR_TIMEOUT if @a cMillies ellapsed without any events.
+ * @retval  VERR_DEADLOCK if @a cMillies is set to RT_INDEFINITE_WAIT and there
+ *          are no valid handles in the set.
+ * @retval  VERR_INTERRUPTED if a signal or other asynchronous event interrupted
+ *          the polling.
+ *
+ * @param   hPollSet            The set to poll on.
+ * @param   cMillies            Number of milliseconds to wait.  Use
+ *                              RT_INDEFINITE_WAIT to wait for ever.
+ * @param   pfEvents            Where to return details about the events that
+ *                              occured.  Optional.
+ * @param   pid                 Where to return the ID associated with the
+ *                              handle when calling RTPollSetAdd.  Optional.
+ */
+RTDECL(int) RTPollNoResume(RTPOLLSET hPollSet, RTMSINTERVAL cMillies, uint32_t *pfEvents, uint32_t *pid);
 
 /**
@@ -70,5 +100,5 @@
  *
  * @returns IPRT status code.
- * @param   phPollSet       Where to return the poll set handle.
+ * @param   phPollSet           Where to return the poll set handle.
  */
 RTDECL(int)  RTPollSetCreate(PRTPOLLSET hPollSet);
@@ -78,6 +108,6 @@
  *
  * @returns IPRT status code.
- * @param   hPollSet        The poll set to destroy.  NIL_POLLSET is quietly
- *                          ignored (VINF_SUCCESS).
+ * @param   hPollSet            The poll set to destroy.  NIL_POLLSET is quietly
+ *                              ignored (VINF_SUCCESS).
  */
 RTDECL(int)  RTPollSetDestroy(RTPOLLSET hPollSet);
@@ -87,8 +117,8 @@
  *
  * @returns IPRT status code
- * @param   hPollSet        The poll set to modify.
- * @param   pHandle         The handle to add.
- * @param   fEvents         Which events to poll for.
- * @param   id              The handle ID.
+ * @param   hPollSet            The poll set to modify.
+ * @param   pHandle             The handle to add.
+ * @param   fEvents             Which events to poll for.
+ * @param   id                  The handle ID.
  */
 RTDECL(int) RTPollSetAdd(RTPOLLSET hPollSet, PCRTHANDLE pHandle, uint32_t fEvents, uint32_t id);
@@ -98,17 +128,43 @@
  *
  * @returns IPRT status code
- * @param   hPollSet        The poll set to modify.
- * @param   id              The handle ID of the handle that should be removed.
+ * @param   hPollSet            The poll set to modify.
+ * @param   id                  The handle ID of the handle that should be
+ *                              removed.
  */
 RTDECL(int) RTPollSetRemove(RTPOLLSET hPollSet, uint32_t id);
 
+
+/**
+ * Query a handle in the poll set by it's ID.
+ *
+ * @returns IPRT status code
+ * @retval  VINF_SUCCESS if the handle was found.  @a *pHandle is set.
+ * @retval  VERR_NOT_FOUND if there is no handle with that ID.
+ * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
+ *
+ * @param   hPollSet            The poll set to query.
+ * @param   id                  The ID of the handle.
+ * @param   pHandle             Where to return the handle details.  Optional.
+ */
+RTDECL(int) RTPollSetQueryHandle(RTPOLLSET hPollSet, uint32_t id, PRTHANDLE pHandle);
+
+/**
+ * Gets the number of handles in the set.
+ *
+ * @retval  The handle count.
+ * @retval  UINT32_MAX if @a hPollSet is invalid.
+ *
+ * @param   hPollSet            The poll set.
+ */
+RTDECL(uint32_t) RTPollSetCount(RTPOLLSET hPollSet);
+
 /**
  * Adds a pipe handle to the set.
  *
  * @returns IPRT status code.
- * @param   hPollSet        The poll set.
- * @param   hPipe           The pipe handle.
- * @param   fEvents         Which events to poll for.
- * @param   id              The handle ID.
+ * @param   hPollSet            The poll set.
+ * @param   hPipe               The pipe handle.
+ * @param   fEvents             Which events to poll for.
+ * @param   id                  The handle ID.
  *
  * @todo    Maybe we could figure out what to poll for depending on the kind of
@@ -127,8 +183,8 @@
  *
  * @returns IPRT status code.
- * @param   hPollSet        The poll set.
- * @param   hSocket         The socket handle.
- * @param   fEvents         Which events to poll for.
- * @param   id              The handle ID.
+ * @param   hPollSet            The poll set.
+ * @param   hSocket             The socket handle.
+ * @param   fEvents             Which events to poll for.
+ * @param   id                  The handle ID.
  */
 DECLINLINE(int) RTPollSetAddSocket(RTPOLLSET hPollSet, RTSOCKET hSocket, uint32_t fEvents, uint32_t id)
