Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/aio_write.2
Show First 20 Lines • Show All 82 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 not | can be modified during the request as context, so this value must not | ||||
be referenced after the request is enqueued. | 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_write | .Fn aio_write | ||||
system call to avoid passing bogus context information to the kernel. | system 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 has been enqueued | ||||
request has completed, are not allowed. | but not yet completed. | ||||
.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_write | .Rv -std aio_write | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |