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[], int nitems,
12                       const struct timespec *restrict 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(2)).
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 at‐
56       tributes(7).
57
58       ┌────────────────────────────────────────────┬───────────────┬─────────┐
59Interface                                   Attribute     Value   
60       ├────────────────────────────────────────────┼───────────────┼─────────┤
61aio_suspend()                               │ Thread safety │ MT-Safe │
62       └────────────────────────────────────────────┴───────────────┴─────────┘
63

CONFORMING TO

65       POSIX.1-2001, POSIX.1-2008.
66
67       POSIX doesn't specify the parameters to be restrict; that  is  specific
68       to glibc.
69

NOTES

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

BUGS

83       The glibc implementation of aio_suspend() is not async-signal-safe,  in
84       violation of the requirements of POSIX.1.
85

SEE ALSO

87       aio_cancel(3),  aio_error(3), aio_fsync(3), aio_read(3), aio_return(3),
88       aio_write(3), lio_listio(3), aio(7), time(7)
89

COLOPHON

91       This page is part of release 5.13 of the Linux  man-pages  project.   A
92       description  of  the project, information about reporting bugs, and the
93       latest    version    of    this    page,    can     be     found     at
94       https://www.kernel.org/doc/man-pages/.
95
96
97
98                                  2021-03-22                    AIO_SUSPEND(3)
Impressum