1.\" $NetBSD: aio_error.3,v 1.3 2007/08/07 20:45:03 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_error.2,v 1.20 2006/09/26 09:47:46 vd Exp $ 28.\" 29.Dd May 4, 2007 30.Dt AIO_ERROR 3 31.Os 32.Sh NAME 33.Nm aio_error 34.Nd retrieve error status of asynchronous I/O operation (REALTIME) 35.Sh LIBRARY 36.Lb librt 37.Sh SYNOPSIS 38.In aio.h 39.Ft int 40.Fn aio_error "const struct aiocb *aiocbp" 41.Sh DESCRIPTION 42The 43.Fn aio_error 44system call returns the error status of the asynchronous I/O request 45associated with the structure pointed to by 46.Fa aiocbp . 47.Sh RETURN VALUES 48If the asynchronous I/O request has completed successfully, 49.Fn aio_error 50returns 0. 51If the request has not yet completed, 52.Er EINPROGRESS 53is returned. 54If the request has completed unsuccessfully the error 55status is returned as described in 56.Xr read 2 , 57.Xr write 2 , 58or 59.Xr fsync 2 . 60On failure, 61.Fn aio_error 62returns \-1 and sets 63.Va errno 64to indicate the error condition. 65.Sh ERRORS 66The 67.Fn aio_error 68system call will fail if: 69.Bl -tag -width Er 70.It Bq Er EINVAL 71The 72.Fa aiocb 73argument 74does not reference an outstanding asynchronous I/O request. 75.El 76.Sh SEE ALSO 77.Xr fsync 2 , 78.Xr read 2 , 79.Xr write 2 , 80.Xr aio_cancel 3 , 81.Xr aio_read 3 , 82.Xr aio_return 3 , 83.Xr aio_suspend 3 , 84.Xr aio_write 3 85.Sh STANDARDS 86The 87.Fn aio_error 88system call 89is expected to conform to the 90.St -p1003.1-2001 91standard. 92.Sh HISTORY 93The 94.Fn aio_error 95system call first appeared in 96.Nx 5.0 . 97