1aiowait(3C)              Standard C Library Functions              aiowait(3C)
2
3
4

NAME

6       aiowait - wait for completion of asynchronous I/O operation
7

SYNOPSIS

9       #include <sys/asynch.h>
10       #include <sys/time.h>
11
12       aio_result_t *aiowait(const struct timeval *timeout);
13
14

DESCRIPTION

16       The  aiowait()  function  suspends the calling process until one of its
17       outstanding asynchronous I/O operations completes, providing a synchro‐
18       nous method of notification.
19
20
21       If  timeout  is  a non-zero pointer, it specifies a maximum interval to
22       wait for the completion of an asynchronous I/O operation. If timeout is
23       a  zero  pointer, aiowait() blocks indefinitely.  To effect a poll, the
24       timeout parameter should be non-zero, pointing to a zero-valued timeval
25       structure.
26
27
28       The  timeval structure is defined in <sys/time.h> and contains the fol‐
29       lowing members:
30
31         long  tv_sec;           /* seconds */
32         long  tv_usec;          /* and microseconds */
33
34

RETURN VALUES

36       Upon successful completion, aiowait() returns a pointer to  the  result
37       structure  used  when  the  completed  asynchronous  I/O  operation was
38       requested. Upon failure, aiowait() returns −1 and sets errno  to  indi‐
39       cate the error. aiowait() returns 0 if the time limit expires.
40

ERRORS

42       The aiowait() function will fail if:
43
44       EFAULT    The timeout argument points to an address outside the address
45                 space of the requesting process.  See NOTES.
46
47
48       EINTR     The execution of aiowait() was interrupted by a signal.
49
50
51       EINVAL    There are no outstanding asynchronous I/O requests.
52
53
54       EINVAL    The tv_secs member of the timeval  structure  pointed  to  by
55                 timeout is less than 0 or the tv_usecs member is greater than
56                 the number of seconds in a microsecond.
57
58

ATTRIBUTES

60       See attributes(5) for descriptions of the following attributes:
61
62
63
64
65       ┌─────────────────────────────┬─────────────────────────────┐
66       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
67       ├─────────────────────────────┼─────────────────────────────┤
68       │MT-Level                     │Safe                         │
69       └─────────────────────────────┴─────────────────────────────┘
70

SEE ALSO

72       aiocancel(3C), aioread(3C), attributes(5)
73

NOTES

75       The aiowait() function is the only way to dequeue an asynchronous noti‐
76       fication. It can be used either inside a SIGIO signal handler or in the
77       main program. One SIGIO signal can represent several queued events.
78
79
80       Passing an illegal address as timeout will result in setting  errno  to
81       EFAULT only if detected by the application process.
82
83
84
85SunOS 5.11                        5 Feb 2008                       aiowait(3C)
Impressum