xref: /freebsd/lib/libsys/aio_return.2 (revision e24279e0f9e28ba0c1920cb539fc357568790c0a)
1*8269e767SBrooks Davis.\" Copyright (c) 1999 Softweyr LLC.
2*8269e767SBrooks Davis.\" All rights reserved.
3*8269e767SBrooks Davis.\"
4*8269e767SBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5*8269e767SBrooks Davis.\" modification, are permitted provided that the following conditions
6*8269e767SBrooks Davis.\" are met:
7*8269e767SBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8*8269e767SBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9*8269e767SBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10*8269e767SBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11*8269e767SBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12*8269e767SBrooks Davis.\"
13*8269e767SBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY Softweyr LLC AND CONTRIBUTORS ``AS IS'' AND
14*8269e767SBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*8269e767SBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*8269e767SBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL Softweyr LLC OR CONTRIBUTORS BE LIABLE
17*8269e767SBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*8269e767SBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*8269e767SBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*8269e767SBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*8269e767SBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*8269e767SBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*8269e767SBrooks Davis.\" SUCH DAMAGE.
24*8269e767SBrooks Davis.\"
25*8269e767SBrooks Davis.Dd January 11, 2021
26*8269e767SBrooks Davis.Dt AIO_RETURN 2
27*8269e767SBrooks Davis.Os
28*8269e767SBrooks Davis.Sh NAME
29*8269e767SBrooks Davis.Nm aio_return
30*8269e767SBrooks Davis.Nd retrieve return status of asynchronous I/O operation (REALTIME)
31*8269e767SBrooks Davis.Sh LIBRARY
32*8269e767SBrooks Davis.Lb libc
33*8269e767SBrooks Davis.Sh SYNOPSIS
34*8269e767SBrooks Davis.In aio.h
35*8269e767SBrooks Davis.Ft ssize_t
36*8269e767SBrooks Davis.Fn aio_return "struct aiocb *iocb"
37*8269e767SBrooks Davis.Sh DESCRIPTION
38*8269e767SBrooks DavisThe
39*8269e767SBrooks Davis.Fn aio_return
40*8269e767SBrooks Davissystem call returns the final status of the asynchronous I/O request
41*8269e767SBrooks Davisassociated with the structure pointed to by
42*8269e767SBrooks Davis.Fa iocb .
43*8269e767SBrooks Davis.Pp
44*8269e767SBrooks DavisThe
45*8269e767SBrooks Davis.Fn aio_return
46*8269e767SBrooks Davissystem call
47*8269e767SBrooks Davisshould only be called once, to obtain the final status of an asynchronous
48*8269e767SBrooks DavisI/O operation once it has completed
49*8269e767SBrooks Davis.Xr ( aio_error 2
50*8269e767SBrooks Davisreturns something other than
51*8269e767SBrooks Davis.Er EINPROGRESS ) .
52*8269e767SBrooks Davis.Sh RETURN VALUES
53*8269e767SBrooks DavisIf the asynchronous I/O request has completed, the status is returned
54*8269e767SBrooks Davisas described in
55*8269e767SBrooks Davis.Xr read 2 ,
56*8269e767SBrooks Davis.Xr readv 2 ,
57*8269e767SBrooks Davis.Xr write 2 ,
58*8269e767SBrooks Davis.Xr writev 2 ,
59*8269e767SBrooks Davisor
60*8269e767SBrooks Davis.Xr fsync 2 .
61*8269e767SBrooks DavisOtherwise,
62*8269e767SBrooks Davis.Fn aio_return
63*8269e767SBrooks Davisreturns \-1 and sets
64*8269e767SBrooks Davis.Va errno
65*8269e767SBrooks Davisto indicate the error condition.
66*8269e767SBrooks Davis.Sh ERRORS
67*8269e767SBrooks DavisThe
68*8269e767SBrooks Davis.Fn aio_return
69*8269e767SBrooks Davissystem call will fail if:
70*8269e767SBrooks Davis.Bl -tag -width Er
71*8269e767SBrooks Davis.It Bq Er EINVAL
72*8269e767SBrooks DavisThe
73*8269e767SBrooks Davis.Fa iocb
74*8269e767SBrooks Davisargument
75*8269e767SBrooks Davisdoes not reference a completed asynchronous I/O request.
76*8269e767SBrooks Davis.It Bq Er EINVAL
77*8269e767SBrooks DavisThe I/O operation was submitted with
78*8269e767SBrooks Davis.Fn lio_listio ,
79*8269e767SBrooks Davisand the value of the
80*8269e767SBrooks Davis.Fa aio_lio_opcode
81*8269e767SBrooks Davisis invalid.
82*8269e767SBrooks Davis.El
83*8269e767SBrooks Davis.Sh SEE ALSO
84*8269e767SBrooks Davis.Xr aio_cancel 2 ,
85*8269e767SBrooks Davis.Xr aio_error 2 ,
86*8269e767SBrooks Davis.Xr aio_suspend 2 ,
87*8269e767SBrooks Davis.Xr aio_waitcomplete 2 ,
88*8269e767SBrooks Davis.Xr aio_write 2 ,
89*8269e767SBrooks Davis.Xr fsync 2 ,
90*8269e767SBrooks Davis.Xr read 2 ,
91*8269e767SBrooks Davis.Xr write 2 ,
92*8269e767SBrooks Davis.Xr aio 4
93*8269e767SBrooks Davis.Sh STANDARDS
94*8269e767SBrooks DavisThe
95*8269e767SBrooks Davis.Fn aio_return
96*8269e767SBrooks Davissystem call
97*8269e767SBrooks Davisis expected to conform to the
98*8269e767SBrooks Davis.St -p1003.1
99*8269e767SBrooks Davisstandard.
100*8269e767SBrooks Davis.Sh HISTORY
101*8269e767SBrooks DavisThe
102*8269e767SBrooks Davis.Fn aio_return
103*8269e767SBrooks Davissystem call first appeared in
104*8269e767SBrooks Davis.Fx 3.0 .
105*8269e767SBrooks Davis.Sh AUTHORS
106*8269e767SBrooks DavisThis
107*8269e767SBrooks Davismanual page was written by
108*8269e767SBrooks Davis.An Wes Peters Aq Mt wes@softweyr.com .
109