]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libc/sys/aio_suspend.2
zfs: merge openzfs/zfs@0ee9b0239
[FreeBSD/FreeBSD.git] / lib / libc / sys / aio_suspend.2
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
38 The
39 .Fn aio_suspend
40 system call suspends the calling process until at least one of the
41 specified asynchronous I/O requests have completed, a signal is
42 delivered, or the
43 .Fa timeout
44 has passed.
45 .Pp
46 The
47 .Fa iocbs
48 argument
49 is an array of
50 .Fa niocb
51 pointers to asynchronous I/O requests.
52 Array members containing
53 null pointers will be silently ignored.
54 .Pp
55 If
56 .Fa timeout
57 is not a null pointer, it specifies a maximum interval to suspend.
58 If
59 .Fa timeout
60 is a null pointer, the suspend blocks indefinitely.
61 To effect a
62 poll, the
63 .Fa timeout
64 should point to a zero-value timespec structure.
65 .Sh RETURN VALUES
66 If one or more of the specified asynchronous I/O requests have
67 completed,
68 .Fn aio_suspend
69 returns 0.
70 Otherwise it returns -1 and sets
71 .Va errno
72 to indicate the error, as enumerated below.
73 .Sh ERRORS
74 The
75 .Fn aio_suspend
76 system call will fail if:
77 .Bl -tag -width Er
78 .It Bq Er EAGAIN
79 the
80 .Fa timeout
81 expired before any I/O requests completed.
82 .It Bq Er EINVAL
83 The
84 .Fa iocbs
85 argument
86 contains more asynchronous I/O requests than the
87 .Va vfs.aio.max_aio_queue_per_proc
88 .Xr sysctl 8
89 variable, or at least one of the requests is not valid.
90 .It Bq Er EINTR
91 the 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
101 The
102 .Fn aio_suspend
103 system call
104 is expected to conform to the
105 .St -p1003.1
106 standard.
107 .Sh HISTORY
108 The
109 .Fn aio_suspend
110 system call first appeared in
111 .Fx 3.0 .
112 .Sh AUTHORS
113 This
114 manual page was written by
115 .An Wes Peters Aq Mt wes@softweyr.com .