VirtualBox

Changeset 26756 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Feb 24, 2010 5:02:41 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58009
Message:

iprt/poll.h: Fixes and additions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/poll.h

    r26731 r26756  
    5656 *
    5757 * @returns IPRT status code.
    58  * @param   hPollSet        The set to poll on.
    59  * @param   cMillies        Number of milliseconds to wait.  Use
    60  *                          RT_INDEFINITE_WAIT to wait for ever.
    61  * @param   pfEvent         Where to return details about the events that
    62  *                          occured.  Optional.
    63  * @param   pid             Where to return the ID associated with the handle
    64  *                          when calling RTPollSetAdd.  Optional.
    65  */
    66 RTDECL(int) RTPoll(RTPIPE hPipe, RTMSINTERVAL cMillies, uint32_t *pfEvent, uint32_t *pid);
     58 * @retval  VINF_SUCCESS if an event occured on a handle.  Note that these
     59 * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
     60 * @retval  VERR_TIMEOUT if @a cMillies ellapsed without any events.
     61 * @retval  VERR_DEADLOCK if @a cMillies is set to RT_INDEFINITE_WAIT and there
     62 *          are no valid handles in the set.
     63 *
     64 * @param   hPollSet            The set to poll on.
     65 * @param   cMillies            Number of milliseconds to wait.  Use
     66 *                              RT_INDEFINITE_WAIT to wait for ever.
     67 * @param   pfEvents            Where to return details about the events that
     68 *                              occured.  Optional.
     69 * @param   pid                 Where to return the ID associated with the
     70 *                              handle when calling RTPollSetAdd.  Optional.
     71 *
     72 * @sa      RTPollNoResume
     73 */
     74RTDECL(int) RTPoll(RTPOLLSET hPollSet, RTMSINTERVAL cMillies, uint32_t *pfEvents, uint32_t *pid);
     75
     76/**
     77 * Same as RTPoll except that it will return when interrupted.
     78 *
     79 * @returns IPRT status code.
     80 * @retval  VINF_SUCCESS if an event occured on a handle.  Note that these
     81 * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
     82 * @retval  VERR_TIMEOUT if @a cMillies ellapsed without any events.
     83 * @retval  VERR_DEADLOCK if @a cMillies is set to RT_INDEFINITE_WAIT and there
     84 *          are no valid handles in the set.
     85 * @retval  VERR_INTERRUPTED if a signal or other asynchronous event interrupted
     86 *          the polling.
     87 *
     88 * @param   hPollSet            The set to poll on.
     89 * @param   cMillies            Number of milliseconds to wait.  Use
     90 *                              RT_INDEFINITE_WAIT to wait for ever.
     91 * @param   pfEvents            Where to return details about the events that
     92 *                              occured.  Optional.
     93 * @param   pid                 Where to return the ID associated with the
     94 *                              handle when calling RTPollSetAdd.  Optional.
     95 */
     96RTDECL(int) RTPollNoResume(RTPOLLSET hPollSet, RTMSINTERVAL cMillies, uint32_t *pfEvents, uint32_t *pid);
    6797
    6898/**
     
    70100 *
    71101 * @returns IPRT status code.
    72  * @param   phPollSet       Where to return the poll set handle.
     102 * @param   phPollSet           Where to return the poll set handle.
    73103 */
    74104RTDECL(int)  RTPollSetCreate(PRTPOLLSET hPollSet);
     
    78108 *
    79109 * @returns IPRT status code.
    80  * @param   hPollSet        The poll set to destroy.  NIL_POLLSET is quietly
    81  *                          ignored (VINF_SUCCESS).
     110 * @param   hPollSet            The poll set to destroy.  NIL_POLLSET is quietly
     111 *                              ignored (VINF_SUCCESS).
    82112 */
    83113RTDECL(int)  RTPollSetDestroy(RTPOLLSET hPollSet);
     
    87117 *
    88118 * @returns IPRT status code
    89  * @param   hPollSet        The poll set to modify.
    90  * @param   pHandle         The handle to add.
    91  * @param   fEvents         Which events to poll for.
    92  * @param   id              The handle ID.
     119 * @param   hPollSet            The poll set to modify.
     120 * @param   pHandle             The handle to add.
     121 * @param   fEvents             Which events to poll for.
     122 * @param   id                  The handle ID.
    93123 */
    94124RTDECL(int) RTPollSetAdd(RTPOLLSET hPollSet, PCRTHANDLE pHandle, uint32_t fEvents, uint32_t id);
     
    98128 *
    99129 * @returns IPRT status code
    100  * @param   hPollSet        The poll set to modify.
    101  * @param   id              The handle ID of the handle that should be removed.
     130 * @param   hPollSet            The poll set to modify.
     131 * @param   id                  The handle ID of the handle that should be
     132 *                              removed.
    102133 */
    103134RTDECL(int) RTPollSetRemove(RTPOLLSET hPollSet, uint32_t id);
    104135
     136
     137/**
     138 * Query a handle in the poll set by it's ID.
     139 *
     140 * @returns IPRT status code
     141 * @retval  VINF_SUCCESS if the handle was found.  @a *pHandle is set.
     142 * @retval  VERR_NOT_FOUND if there is no handle with that ID.
     143 * @retval  VERR_INVALID_HANDLE if @a hPollSet is invalid.
     144 *
     145 * @param   hPollSet            The poll set to query.
     146 * @param   id                  The ID of the handle.
     147 * @param   pHandle             Where to return the handle details.  Optional.
     148 */
     149RTDECL(int) RTPollSetQueryHandle(RTPOLLSET hPollSet, uint32_t id, PRTHANDLE pHandle);
     150
     151/**
     152 * Gets the number of handles in the set.
     153 *
     154 * @retval  The handle count.
     155 * @retval  UINT32_MAX if @a hPollSet is invalid.
     156 *
     157 * @param   hPollSet            The poll set.
     158 */
     159RTDECL(uint32_t) RTPollSetCount(RTPOLLSET hPollSet);
     160
    105161/**
    106162 * Adds a pipe handle to the set.
    107163 *
    108164 * @returns IPRT status code.
    109  * @param   hPollSet        The poll set.
    110  * @param   hPipe           The pipe handle.
    111  * @param   fEvents         Which events to poll for.
    112  * @param   id              The handle ID.
     165 * @param   hPollSet            The poll set.
     166 * @param   hPipe               The pipe handle.
     167 * @param   fEvents             Which events to poll for.
     168 * @param   id                  The handle ID.
    113169 *
    114170 * @todo    Maybe we could figure out what to poll for depending on the kind of
     
    127183 *
    128184 * @returns IPRT status code.
    129  * @param   hPollSet        The poll set.
    130  * @param   hSocket         The socket handle.
    131  * @param   fEvents         Which events to poll for.
    132  * @param   id              The handle ID.
     185 * @param   hPollSet            The poll set.
     186 * @param   hSocket             The socket handle.
     187 * @param   fEvents             Which events to poll for.
     188 * @param   id                  The handle ID.
    133189 */
    134190DECLINLINE(int) RTPollSetAddSocket(RTPOLLSET hPollSet, RTSOCKET hSocket, uint32_t fEvents, uint32_t id)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette