1aio_suspend(3)             Library Functions Manual             aio_suspend(3)
2
3
4

NAME

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

LIBRARY

9       Real-time library (librt, -lrt)
10

SYNOPSIS

12       #include <aio.h>
13
14       int aio_suspend(const struct aiocb *const aiocb_list[], int nitems,
15                       const struct timespec *restrict timeout);
16

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

ATTRIBUTES

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

STANDARDS

63       POSIX.1-2008.
64

HISTORY

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

NOTES

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

BUGS

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

SEE ALSO

88       aio_cancel(3),  aio_error(3), aio_fsync(3), aio_read(3), aio_return(3),
89       aio_write(3), lio_listio(3), aio(7), time(7)
90
91
92
93Linux man-pages 6.05              2023-07-20                    aio_suspend(3)
Impressum