mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
aio_read2/aio_write2: add AIO_OP2_VECTORED
Suggested by: Vinícius dos Santos Oliveira <vini.ipsmaker@gmail.com> Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43448
This commit is contained in:
parent
06cb1c3f95
commit
8dfc788b84
@ -37,13 +37,15 @@ aio_read2(struct aiocb *iocb, int flags)
|
||||
{
|
||||
int error;
|
||||
|
||||
if ((flags & ~(AIO_OP2_FOFFSET)) != 0) {
|
||||
if ((flags & ~(AIO_OP2_FOFFSET | AIO_OP2_VECTORED)) != 0) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
iocb->aio_lio_opcode = LIO_READ;
|
||||
if ((flags & AIO_OP2_FOFFSET) != 0)
|
||||
iocb->aio_lio_opcode |= LIO_FOFFSET;
|
||||
if ((flags & AIO_OP2_VECTORED) != 0)
|
||||
iocb->aio_lio_opcode |= LIO_VECTORED;
|
||||
|
||||
error = lio_listio(LIO_NOWAIT, &iocb, 1, NULL);
|
||||
if (error == -1 && errno == EIO) {
|
||||
|
@ -37,13 +37,15 @@ aio_write2(struct aiocb *iocb, int flags)
|
||||
{
|
||||
int error;
|
||||
|
||||
if ((flags & ~(AIO_OP2_FOFFSET)) != 0) {
|
||||
if ((flags & ~(AIO_OP2_FOFFSET | AIO_OP2_VECTORED)) != 0) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
iocb->aio_lio_opcode = LIO_WRITE;
|
||||
if ((flags & AIO_OP2_FOFFSET) != 0)
|
||||
iocb->aio_lio_opcode |= LIO_FOFFSET;
|
||||
if ((flags & AIO_OP2_VECTORED) != 0)
|
||||
iocb->aio_lio_opcode |= LIO_VECTORED;
|
||||
|
||||
error = lio_listio(LIO_NOWAIT, &iocb, 1, NULL);
|
||||
if (error == -1 && errno == EIO) {
|
||||
|
@ -58,6 +58,7 @@
|
||||
/* aio_read2/aio_write2 flags */
|
||||
#if __BSD_VISIBLE
|
||||
#define AIO_OP2_FOFFSET 0x00000001
|
||||
#define AIO_OP2_VECTORED 0x00000002
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user