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