aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/sys/aio_read.2
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/sys/aio_read.2')
-rw-r--r--lib/libc/sys/aio_read.263
1 files changed, 52 insertions, 11 deletions
diff --git a/lib/libc/sys/aio_read.2 b/lib/libc/sys/aio_read.2
index bbf96cc89890..0327ef1f747b 100644
--- a/lib/libc/sys/aio_read.2
+++ b/lib/libc/sys/aio_read.2
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd August 19, 2016
+.Dd January 2, 2021
.Dt AIO_READ 2
.Os
.Sh NAME
-.Nm aio_read
+.Nm aio_read ,
+.Nm aio_readv
.Nd asynchronous read from a file (REALTIME)
.Sh LIBRARY
.Lb libc
@@ -36,21 +37,42 @@
.In aio.h
.Ft int
.Fn aio_read "struct aiocb *iocb"
+.In sys/uio.h
+.Ft int
+.Fn aio_readv "struct aiocb *iocb"
.Sh DESCRIPTION
The
.Fn aio_read
-system call allows the calling process to read
-.Fa iocb->aio_nbytes
+and
+.Fn aio_readv
+system calls allow the calling process to read
from the descriptor
.Fa iocb->aio_fildes
beginning at the offset
-.Fa iocb->aio_offset
-into the buffer pointed to by
-.Fa iocb->aio_buf .
-The call returns immediately after the read request has
+.Fa iocb->aio_offset .
+.Fn aio_read
+will read
+.Fa iocb->aio_nbytes
+from the buffer pointed to by
+.Fa iocb->aio_buf ,
+whereas
+.Fn aio_readv
+reads the data into the
+.Fa iocb->aio_iovcnt
+buffers specified by the members of the
+.Fa iocb->aio_iov
+array.
+Both syscalls return immediately after the read request has
been enqueued to the descriptor; the read may or may not have
completed at the time the call returns.
.Pp
+For
+.Fn aio_readv
+the
+.Fa iovec
+structure is defined in
+.Xr readv 2 .
+.Pp
If _POSIX_PRIORITIZED_IO is defined, and the descriptor supports it,
then the enqueued operation is submitted at a priority equal to that
of the calling process minus
@@ -61,7 +83,9 @@ The
argument
is ignored by the
.Fn aio_read
-system call.
+and
+.Fn aio_readv
+system calls.
.Pp
The
.Fa iocb
@@ -108,16 +132,22 @@ is past the offset maximum for
.Fa iocb->aio_fildes ,
no I/O will occur.
.Sh RETURN VALUES
-.Rv -std aio_read
+.Rv -std aio_read aio_readv
.Sh DIAGNOSTICS
None.
.Sh ERRORS
The
.Fn aio_read
-system call will fail if:
+and
+.Fn aio_readv
+system calls will fail if:
.Bl -tag -width Er
.It Bq Er EAGAIN
The request was not queued because of system resource limitations.
+.It Bq Er EFAULT
+Part of
+.Fa aio_iov
+points outside the process's allocated address space.
.It Bq Er EINVAL
The asynchronous notification method in
.Fa iocb->aio_sigevent.sigev_notify
@@ -130,10 +160,14 @@ are unsafe and unsafe asynchronous I/O operations are disabled.
.Pp
The following conditions may be synchronously detected when the
.Fn aio_read
+or
+.Fn aio_readv
system call is made, or asynchronously, at any time thereafter.
If they
are detected at call time,
.Fn aio_read
+or
+.Fn aio_readv
returns -1 and sets
.Va errno
appropriately; otherwise the
@@ -207,11 +241,18 @@ The
system call is expected to conform to the
.St -p1003.1
standard.
+The
+.Fn aio_readv
+system call is a FreeBSD extension, and should not be used in portable code.
.Sh HISTORY
The
.Fn aio_read
system call first appeared in
.Fx 3.0 .
+The
+.Fn aio_readv
+system call first appeared in
+.Fx 13.0 .
.Sh AUTHORS
This
manual page was written by