Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/sys/aio_read.2
Show All 18 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd July 21, 2016 | .Dd August 19, 2016 | ||||
.Dt AIO_READ 2 | .Dt AIO_READ 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm aio_read | .Nm aio_read | ||||
.Nd asynchronous read from a file (REALTIME) | .Nd asynchronous read from a file (REALTIME) | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
.Pp | .Pp | ||||
If the request is successfully enqueued, the value of | If the request is successfully enqueued, the value of | ||||
.Fa iocb->aio_offset | .Fa iocb->aio_offset | ||||
can be modified during the request as context, so this value must | can be modified during the request as context, so this value must | ||||
not be referenced after the request is enqueued. | not be referenced after the request is enqueued. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fa iocb->aio_sigevent | .Fa iocb->aio_sigevent | ||||
structure can be used to request notification of the request's | structure can be used to request notification of the operation's | ||||
completion as described in | completion as described in | ||||
.Xr aio 4 . | .Xr aio 4 . | ||||
.Sh RESTRICTIONS | .Sh RESTRICTIONS | ||||
The Asynchronous I/O Control Block structure pointed to by | The Asynchronous I/O Control Block structure pointed to by | ||||
.Fa iocb | .Fa iocb | ||||
and the buffer that the | and the buffer that the | ||||
.Fa iocb->aio_buf | .Fa iocb->aio_buf | ||||
member of that structure references must remain valid until the | member of that structure references must remain valid until the | ||||
operation has completed. | operation has completed. | ||||
For this reason, use of auto (stack) variables | |||||
for these objects is discouraged. | |||||
.Pp | .Pp | ||||
The asynchronous I/O control buffer | The asynchronous I/O control buffer | ||||
.Fa iocb | .Fa iocb | ||||
should be zeroed before the | should be zeroed before the | ||||
.Fn aio_read | .Fn aio_read | ||||
call to avoid passing bogus context information to the kernel. | call to avoid passing bogus context information to the kernel. | ||||
.Pp | .Pp | ||||
Modifications of the Asynchronous I/O Control Block structure or the | Modifications of the Asynchronous I/O Control Block structure or the | ||||
buffer contents after the request has been enqueued, but before the | buffer contents are not allowed while the request is queued. | ||||
request has completed, are not allowed. | |||||
.Pp | .Pp | ||||
If the file offset in | If the file offset in | ||||
.Fa iocb->aio_offset | .Fa iocb->aio_offset | ||||
is past the offset maximum for | is past the offset maximum for | ||||
.Fa iocb->aio_fildes , | .Fa iocb->aio_fildes , | ||||
no I/O will occur. | no I/O will occur. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Rv -std aio_read | .Rv -std aio_read | ||||
▲ Show 20 Lines • Show All 111 Lines • Show Last 20 Lines |