xref: /netbsd/lib/librt/aio_suspend.3 (revision 6550d01e)
1.\" $NetBSD: aio_suspend.3,v 1.5 2011/01/06 15:22:20 njoly 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 17, 2010
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 struct timeout
48(see
49.Xr timespec 3 )
50has passed.
51.Pp
52The
53.Fa list
54argument
55is an array of
56.Fa nent
57pointers to asynchronous I/O requests.
58Array members containing
59.Dv NULL
60pointers will be silently ignored.
61.Pp
62If
63.Fa timeout
64is not a
65.Dv NULL
66pointer, it specifies a maximum interval to suspend.
67If
68.Fa timeout
69is a
70.Dv NULL
71pointer, the suspend blocks indefinitely.
72To effect a poll, the
73.Fa timeout
74should point to a zero-value timespec structure.
75.Sh RETURN VALUES
76If one or more of the specified asynchronous I/O requests have
77completed,
78.Fn aio_suspend
79returns 0.
80Otherwise it returns \-1 and sets
81.Va errno
82to indicate the error, as enumerated below.
83.Sh ERRORS
84The
85.Fn aio_suspend
86system call will fail if:
87.Bl -tag -width Er
88.It Bq Er EAGAIN
89The
90.Fa timeout
91expired before any I/O requests completed.
92.It Bq Er EINTR
93The suspend was interrupted by a signal.
94.It Bq Er EINVAL
95The
96.Fa list
97argument
98contains more than
99.Dv AIO_LISTIO_MAX
100asynchronous I/O requests, or at least one of the requests is not
101valid.
102.El
103.Sh SEE ALSO
104.Xr aio 3 ,
105.Xr timespec 3
106.Sh STANDARDS
107The
108.Fn aio_suspend
109system call
110is expected to conform to the
111.St -p1003.1-2001
112standard.
113.Sh HISTORY
114The
115.Fn aio_suspend
116system call first appeared in
117.Nx 5.0 .
118