Bugzilla bug #17806: made the comments for PR_Poll clearer about the
authorwtc%netscape.com
Fri, 09 Jun 2000 23:44:00 +0000
changeset 1420 0a18935b05b38a1efcbe50bd82abe573f3ab9689
parent 1418 71cf41906794c93c04f0731d66832638cdfe3303
child 1421 b55d48e4c56babd443bc2aed69f09e3df6bd58ab
push idunknown
push userunknown
push dateunknown
bugs17806
Bugzilla bug #17806: made the comments for PR_Poll clearer about the fact that the out_flags fields can only be checked on a successful return.
pr/include/prio.h
--- a/pr/include/prio.h
+++ b/pr/include/prio.h
@@ -1863,19 +1863,19 @@ struct PRPollDesc {
 ** FUNCTION:    PR_Poll
 ** DESCRIPTION:
 **
 ** The call returns as soon as I/O is ready on one or more of the underlying
 ** file/socket objects. A count of the number of ready descriptors is
 ** returned unless a timeout occurs in which case zero is returned.
 **
 ** PRPollDesc.in_flags should be set to the desired request
-** (read/write/except or some combination). Upon return from this call
-** PRPollDesc.out_flags will be set to indicate what kind of i/o can be
-** performed on the respective descriptor.
+** (read/write/except or some combination). Upon successful return from
+** this call PRPollDesc.out_flags will be set to indicate what kind of
+** i/o can be performed on the respective descriptor.
 **
 ** INPUTS:
 **      PRPollDesc *pds         A pointer to an array of PRPollDesc
 **
 **      PRIntn npds             The number of elements in the array
 **                              If this argument is zero PR_Poll is
 **                              equivalent to a PR_Sleep(timeout).
 **
@@ -1883,19 +1883,22 @@ struct PRPollDesc {
 **                              for I/O to become ready. If this time expires
 **                              w/o any I/O becoming ready, the result will
 **                              be zero.
 **
 ** OUTPUTS:    None
 ** RETURN:
 **      PRInt32                 Number of PRPollDesc's with events or zero
 **                              if the function timed out or -1 on failure.
-**                              The reason for the failure is obtained by calling 
-**                              PR_GetError().
-** XXX can we implement this on windoze and mac?
+**                              The reason for the failure is obtained by
+**                              calling PR_GetError().  PR_Poll() uses the
+**                              out_flags fields as scratch variables
+**                              during the call.  If PR_Poll() returns 0
+**                              or -1, the out_flags fields do not contain
+**                              meaningful values and must not be used.
 **************************************************************************
 */
 NSPR_API(PRInt32) PR_Poll(
     PRPollDesc *pds, PRIntn npds, PRIntervalTime timeout);
 
 /*
 **************************************************************************
 **