xref: /netbsd-src/lib/librt/aio_suspend.3 (revision 274254cdae52594c1aa480a736aef78313d15c9c)
1.\" $NetBSD: aio_suspend.3,v 1.3 2007/08/07 20:45:04 wiz Exp $
2.\"
3.\" Copyright (c) 1999 Softweyr LLC.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY Softweyr LLC AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL Softweyr LLC OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: /repoman/r/ncvs/src/lib/libc/sys/aio_suspend.2,v 1.22 2004/12/23 23:45:25 keramida Exp $
28.\"
29.Dd May 4, 2007
30.Dt AIO_SUSPEND 3
31.Os
32.Sh NAME
33.Nm aio_suspend
34.Nd suspend until asynchronous I/O operations or timeout complete (REALTIME)
35.Sh LIBRARY
36.Lb librt
37.Sh SYNOPSIS
38.In aio.h
39.Ft int
40.Fn aio_suspend "const struct aiocb * const list[]" "int nent" "const struct timespec * timeout"
41.Sh DESCRIPTION
42The
43.Fn aio_suspend
44system call suspends the calling process until at least one of the
45specified asynchronous I/O requests have completed, a signal is
46delivered, or the
47.Fa timeout
48has passed.
49.Pp
50The
51.Fa list
52argument
53is an array of
54.Fa nent
55pointers to asynchronous I/O requests.
56Array members containing
57null pointers will be silently ignored.
58.Pp
59If
60.Fa timeout
61is not a null pointer, it specifies a maximum interval to suspend.
62If
63.Fa timeout
64is a null pointer, the suspend blocks indefinitely.
65To effect a
66poll, the
67.Fa timeout
68should point to a zero-value timespec structure.
69.Sh RETURN VALUES
70If one or more of the specified asynchronous I/O requests have
71completed,
72.Fn aio_suspend
73returns 0.
74Otherwise it returns \-1 and sets
75.Va errno
76to indicate the error, as enumerated below.
77.Sh ERRORS
78The
79.Fn aio_suspend
80system call will fail if:
81.Bl -tag -width Er
82.It Bq Er EAGAIN
83The
84.Fa timeout
85expired before any I/O requests completed.
86.It Bq Er EINTR
87The suspend was interrupted by a signal.
88.It Bq Er EINVAL
89The
90.Fa list
91argument
92contains more than
93.Dv AIO_LISTIO_MAX
94asynchronous I/O requests, or at least one of the requests is not
95valid.
96.El
97.Sh SEE ALSO
98.Xr aio_cancel 3 ,
99.Xr aio_error 3 ,
100.Xr aio_return 3 ,
101.Xr aio_write 3
102.Sh STANDARDS
103The
104.Fn aio_suspend
105system call
106is expected to conform to the
107.St -p1003.1-2001
108standard.
109.Sh HISTORY
110The
111.Fn aio_suspend
112system call first appeared in
113.Nx 5.0 .
114