]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/aio_suspend.3
Many pages: Add '\" t' comment where necessary
[thirdparty/man-pages.git] / man3 / aio_suspend.3
1 '\" t
2 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
3 .\" and Copyright (C) 2010 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\"
7 .TH aio_suspend 3 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 aio_suspend \- wait for asynchronous I/O operation or timeout
10 .SH LIBRARY
11 Real-time library
12 .RI ( librt ", " \-lrt )
13 .SH SYNOPSIS
14 .nf
15 .PP
16 .B "#include <aio.h>"
17 .PP
18 .BI "int aio_suspend(const struct aiocb *const " aiocb_list "[], int " nitems ,
19 .BI " const struct timespec *restrict " timeout );
20 .fi
21 .SH DESCRIPTION
22 The
23 .BR aio_suspend ()
24 function suspends the calling thread until one of the following occurs:
25 .IP \(bu 3
26 One or more of the asynchronous I/O requests in the list
27 .I aiocb_list
28 has completed.
29 .IP \(bu
30 A signal is delivered.
31 .IP \(bu
32 .I timeout
33 is not NULL and the specified time interval has passed.
34 (For details of the
35 .I timespec
36 structure, see
37 .BR nanosleep (2).)
38 .PP
39 The
40 .I nitems
41 argument specifies the number of items in
42 .IR aiocb_list .
43 Each item in the list pointed to by
44 .I aiocb_list
45 must be either NULL (and then is ignored),
46 or a pointer to a control block on which I/O was initiated using
47 .BR aio_read (3),
48 .BR aio_write (3),
49 or
50 .BR lio_listio (3).
51 (See
52 .BR aio (7)
53 for a description of the
54 .I aiocb
55 structure.)
56 .PP
57 If
58 .B CLOCK_MONOTONIC
59 is supported, this clock is used to measure
60 the timeout interval (see
61 .BR clock_gettime (2)).
62 .SH RETURN VALUE
63 If this function returns after completion of one of the I/O
64 requests specified in
65 .IR aiocb_list ,
66 0 is returned.
67 Otherwise, \-1 is returned, and
68 .I errno
69 is set to indicate the error.
70 .SH ERRORS
71 .TP
72 .B EAGAIN
73 The call timed out before any of the indicated operations
74 had completed.
75 .TP
76 .B EINTR
77 The call was ended by signal
78 (possibly the completion signal of one of the operations we were
79 waiting for); see
80 .BR signal (7).
81 .TP
82 .B ENOSYS
83 .BR aio_suspend ()
84 is not implemented.
85 .SH VERSIONS
86 The
87 .BR aio_suspend ()
88 function is available since glibc 2.1.
89 .SH ATTRIBUTES
90 For an explanation of the terms used in this section, see
91 .BR attributes (7).
92 .ad l
93 .nh
94 .TS
95 allbox;
96 lbx lb lb
97 l l l.
98 Interface Attribute Value
99 T{
100 .BR aio_suspend ()
101 T} Thread safety MT-Safe
102 .TE
103 .hy
104 .ad
105 .sp 1
106 .SH STANDARDS
107 POSIX.1-2001, POSIX.1-2008.
108 .PP
109 POSIX doesn't specify the parameters to be
110 .IR restrict ;
111 that is specific to glibc.
112 .SH NOTES
113 One can achieve polling by using a non-NULL
114 .I timeout
115 that specifies a zero time interval.
116 .PP
117 If one or more of the asynchronous I/O operations specified in
118 .I aiocb_list
119 has already completed at the time of the call to
120 .BR aio_suspend (),
121 then the call returns immediately.
122 .PP
123 To determine which I/O operations have completed
124 after a successful return from
125 .BR aio_suspend (),
126 use
127 .BR aio_error (3)
128 to scan the list of
129 .I aiocb
130 structures pointed to by
131 .IR aiocb_list .
132 .SH BUGS
133 The glibc implementation of
134 .BR aio_suspend ()
135 is not async-signal-safe,
136 .\" FIXME . https://sourceware.org/bugzilla/show_bug.cgi?id=13172
137 in violation of the requirements of POSIX.1.
138 .SH SEE ALSO
139 .BR aio_cancel (3),
140 .BR aio_error (3),
141 .BR aio_fsync (3),
142 .BR aio_read (3),
143 .BR aio_return (3),
144 .BR aio_write (3),
145 .BR lio_listio (3),
146 .BR aio (7),
147 .BR time (7)