]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/aio_suspend.3
sigevent.7: SEE ALSO: Add aio_read(3), aio_write(3), and lio_listio(3)
[thirdparty/man-pages.git] / man3 / aio_suspend.3
CommitLineData
fea681da 1.\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
0cae8d0c 2.\" and Copyright (C) 2010 Michael kerrisk <mtk.manpages@gmail.com>
fea681da
MK
3.\"
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
8.\"
9.\" The GNU General Public License's references to "object code"
10.\" and "executables" are to be interpreted as the output of any
11.\" document formatting or typesetting system, including
12.\" intermediate and printed output.
13.\"
14.\" This manual is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public
20.\" License along with this manual; if not, write to the Free
21.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22.\" USA.
23.\"
25fa6c3d 24.TH AIO_SUSPEND 3 2010-10-02 "" "Linux Programmer's Manual"
fea681da
MK
25.SH NAME
26aio_suspend \- wait for asynchronous I/O operation or timeout
27.SH SYNOPSIS
28.nf
29.sp
30.B "#include <aio.h>"
31.sp
0cae8d0c 32.BI "int aio_suspend(const struct aiocb * const " aiocb_list [],
fea681da 33.br
0cae8d0c 34.BI " int " nitems ", const struct timespec *" timeout );
8d3d329b
MK
35.sp
36Link with \fI\-lrt\fP.
fea681da
MK
37.fi
38.SH DESCRIPTION
39The
e511ffb6 40.BR aio_suspend ()
0cae8d0c
MK
41function suspends the calling thread until one of the following occurs:
42.IP * 3
43One or more of the asynchronous I/O requests in the list
44.I aiocb_list
45has completed.
46.IP *
47A signal is delivered.
48.IP *
fea681da 49.I timeout
0cae8d0c
MK
50is not NULL and the specified time interval has passed.
51(For details of the
52.I timespec
53structure, see
54.BR nanosleep (2).)
fea681da 55.LP
0cae8d0c
MK
56The
57.I nitems
58argument specifies the number of items in
59.IR aiocb_list .
60Each item in the list pointed to by
61.I aiocb_list
62must be either NULL (and then is ignored),
fea681da
MK
63or a pointer to a control block on which I/O was initiated using
64.BR aio_read (3),
65.BR aio_write (3),
66or
67.BR lio_listio (3).
0cae8d0c
MK
68(See
69.BR aio (7)
70for a description of the
71.I aiocb
72structure.)
fea681da 73.LP
2f0af33b
MK
74If
75.B CLOCK_MONOTONIC
76is supported, this clock is used to measure
0cae8d0c
MK
77the timeout interval (see
78.BR clock_gettime (3)).
fea681da 79.SH "RETURN VALUE"
0cae8d0c
MK
80If this function returns after completion of one of the I/O
81requests specified in
82.IR aiocb_list ,
830 is returned.
84Otherwise, \-1 is returned, and
fea681da 85.I errno
0cae8d0c 86is set to indicate the error.
fea681da
MK
87.SH ERRORS
88.TP
89.B EAGAIN
0cae8d0c 90The call timed out before any of the indicated operations
fea681da
MK
91had completed.
92.TP
93.B EINTR
0cae8d0c
MK
94The call was ended by signal
95(possibly the completion signal of one of the operations we were
96waiting for); see
76e533c4 97.BR signal (7).
793514ae
MK
98.SH VERSIONS
99The
100.BR aio_suspend ()
101function is available since glibc 2.1.
2b2581ee 102.SH "CONFORMING TO"
793514ae 103POSIX.1-2001, POSIX.1-2008.
19c98696 104.SH NOTES
fea681da
MK
105One can achieve polling by using a non-NULL
106.I timeout
107that specifies a zero time interval.
0cae8d0c
MK
108
109If one or more of the asynchronous I/O operations specified in
110.IR aiocb_list
111has already completed at the time of the call to
112.BR aio_suspend (),
113then the call returns immediately.
114
115To determine which I/O operations have completed
116after a successful return from
117.BR aio_suspend (),
118use
119.BR aio_error (3)
120to scan the list of
121.I aiocb
122structures pointed to by
123.IR aiocb_list .
fea681da
MK
124.SH "SEE ALSO"
125.BR aio_cancel (3),
126.BR aio_error (3),
127.BR aio_fsync (3),
128.BR aio_read (3),
129.BR aio_return (3),
1d7c4d16 130.BR aio_write (3),
25fa6c3d 131.BR aio (7),
1d7c4d16 132.BR time (7)