1AIO_SUSPEND(3)             Linux Programmer's Manual            AIO_SUSPEND(3)
2
3
4

NAME

6       aio_suspend - wait for asynchronous I/O operation or timeout
7

SYNOPSIS

9       #include <aio.h>
10
11       int aio_suspend(const struct aiocb * const aiocb_list[],
12                       int nitems, const struct timespec *timeout);
13
14       Link with -lrt.
15

DESCRIPTION

17       The aio_suspend() function suspends the calling thread until one of the
18       following occurs:
19
20       *  One or more of the asynchronous I/O requests in the list  aiocb_list
21          has completed.
22
23       *  A signal is delivered.
24
25       *  timeout  is  not  NULL  and  the specified time interval has passed.
26          (For details of the timespec structure, see nanosleep(2).)
27
28       The nitems argument specifies the number of items in aiocb_list.   Each
29       item in the list pointed to by aiocb_list must be either NULL (and then
30       is ignored), or a pointer to a control block on which I/O was initiated
31       using  aio_read(3),  aio_write(3), or lio_listio(3).  (See aio(7) for a
32       description of the aiocb structure.)
33
34       If CLOCK_MONOTONIC is supported, this clock  is  used  to  measure  the
35       timeout interval (see clock_gettime(3)).
36

RETURN VALUE

38       If  this  function  returns after completion of one of the I/O requests
39       specified in aiocb_list, 0 is returned.  Otherwise, -1 is returned, and
40       errno is set to indicate the error.
41

ERRORS

43       EAGAIN The  call  timed  out before any of the indicated operations had
44              completed.
45
46       EINTR  The call was ended by signal (possibly the completion signal  of
47              one of the operations we were waiting for); see signal(7).
48
49       ENOSYS aio_suspend() is not implemented.
50

VERSIONS

52       The aio_suspend() function is available since glibc 2.1.
53

ATTRIBUTES

55       For   an   explanation   of   the  terms  used  in  this  section,  see
56       attributes(7).
57
58       ┌──────────────┬───────────────┬─────────┐
59Interface     Attribute     Value   
60       ├──────────────┼───────────────┼─────────┤
61aio_suspend() │ Thread safety │ MT-Safe │
62       └──────────────┴───────────────┴─────────┘

CONFORMING TO

64       POSIX.1-2001, POSIX.1-2008.
65

NOTES

67       One can achieve polling by using a non-NULL timeout  that  specifies  a
68       zero time interval.
69
70       If  one  or  more  of  the  asynchronous  I/O  operations  specified in
71       aiocb_list has already completed at the time of the  call  to  aio_sus‐
72       pend(), then the call returns immediately.
73
74       To  determine  which  I/O  operations have completed after a successful
75       return from aio_suspend(), use aio_error(3) to scan the list  of  aiocb
76       structures pointed to by aiocb_list.
77

BUGS

79       The  glibc implementation of aio_suspend() is not async-signal-safe, in
80       violation of the requirements of POSIX.1.
81

SEE ALSO

83       aio_cancel(3), aio_error(3), aio_fsync(3), aio_read(3),  aio_return(3),
84       aio_write(3), lio_listio(3), aio(7), time(7)
85

COLOPHON

87       This  page  is  part of release 4.15 of the Linux man-pages project.  A
88       description of the project, information about reporting bugs,  and  the
89       latest     version     of     this    page,    can    be    found    at
90       https://www.kernel.org/doc/man-pages/.
91
92
93
94                                  2017-09-15                    AIO_SUSPEND(3)
Impressum