mirror of
https://github.com/opnsense/src.git
synced 2026-04-20 21:59:20 -04:00
aio_read2/aio_write2: add AIO_OP2_VECTORED
(cherry picked from commit 8dfc788b8480a13f1f945f0a94d8b1e327af5c6f)
This commit is contained in:
parent
e9014ead57
commit
e331ce2d60
3 changed files with 7 additions and 2 deletions
|
|
@ -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 a new issue