unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

AIOWAIT(3)                 Library Functions Manual                 AIOWAIT(3)



NAME
       aiowait - wait for completion of asynchronous I/O operation

SYNOPSIS
       #include <&lt;sys/asynch.h>&gt;
       #include <&lt;sys/time.h>&gt;

       aio_result_t *aiowait(timeout)
       struct timeval *timeout;

DESCRIPTION
       aiowait()  suspends  the  calling  process until one of its outstanding
       asynchronous I/O operations completes.   This  provides  a  synchronous
       method of notification.

       If  timeout  is  a non-zero pointer, it specifies a maximum interval to
       wait for the completion of an asynchronous I/O operation.   If  timeout
       is  a  zero  pointer,  then aiowait() blocks indefinitely.  To effect a
       poll, the timeout parameter should be non-zero, pointing to a zero-val-
       ued   timeval   structure.    The   timeval  structure  is  defined  in
       <&lt;sys/time.h>&gt; as:
              struct timeval {
                   long  tv_sec;            /* seconds          */
                   long  tv_usec;           /* and microseconds */
              };

NOTES
       aiowait() is the only way to dequeue an asynchronous notification.   It
       may  be  used  either inside a SIGIO signal handler or in the main pro-
       gram.  Note: one SIGIO signal may represent several queued events.

RETURN VALUES
       On success, aiowait() returns a pointer to the  result  structure  used
       when  the completed asynchronous I/O operation was requested.  On fail-
       ure, it returns -1 and sets errno to  indicate  the  error.   aiowait()
       returns 0 if the time limit expires.

ERRORS
       EFAULT         timeout  points  to an address outside the address space
                      of the requesting process.

       EINTR          A signal was delivered before an asynchronous I/O opera-
                      tion completed.

                      The time limit expired.

       EINVAL         There are no outstanding asynchronous I/O requests.

SEE ALSO
       aiocancel(3), aioread(3)



                                21 January 1990                     AIOWAIT(3)