[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


   NAME
        CheckIO -- get the status of an iorequest

   SYNOPSIS
        result = CheckIO(IORequest)
        D0               A1

        struct iorequest *checkio(struct iorequest *);

   FUNCTION
        This function determines the current state of an I/O request and
        returns FALSE if the I/O has not yet completed.  This function
        effectively hides the internals of the I/O completion mechanism.

        CheckIO() will NOT remove the returned iorequest from the reply port.
        This is best performed with waitio(). if the request has already
        completed, waitio() will return quickly. use of the remove()
        function is dangerous, since other tasks may still be adding things
        to your message port; a disable() would be required.

        This function should NOT be used to busy loop (looping until IO is
        complete).  waitio() is provided for that purpose.

   INPUTS
        iORequest - pointer to an I/O request block

   RESULTS
        result - NULL if I/O is still in progress.  Otherwise
                 D0 points to the iorequest block.

   NOTE
        CheckIO can hang if called on an iorequest that has never been used.
        This occurs if LN_TYPE of the iorequest is set to "nt_message".
        Instead simply set LN_TYPE to 0.

   SEE ALSO
        doio(), sendio(), waitio(), abortio()