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:
Konstantin Belousov 2024-02-03 20:09:36 +02:00
parent 06cb1c3f95
commit 8dfc788b84
3 changed files with 7 additions and 2 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -58,6 +58,7 @@
/* aio_read2/aio_write2 flags */
#if __BSD_VISIBLE
#define AIO_OP2_FOFFSET 0x00000001
#define AIO_OP2_VECTORED 0x00000002
#endif
/*