From 5914e40c2ff7fcf346c90705785f3fb7650a9fdc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 29 Jan 2018 13:27:52 -0800 Subject: Expose scatter/gather I/O vectors; we will use for HTTP API. --- src/core/aio.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/core/aio.h') diff --git a/src/core/aio.h b/src/core/aio.h index b5db29c9..33fe07cb 100644 --- a/src/core/aio.h +++ b/src/core/aio.h @@ -39,8 +39,10 @@ struct nni_aio { nni_task a_task; // Read/write operations. - nni_iov a_iov[4]; - int a_niov; + nni_iov *a_iov; + int a_niov; + nni_iov a_iovinl[4]; // inline IOVs - when the IOV list is short + int a_niovalloc; // number of allocated IOVs // Message operations. nni_msg *a_msg; @@ -126,6 +128,11 @@ extern void nni_aio_set_output(nni_aio *, int, void *); // nni_get_output returns an output previously stored on the AIO. extern void *nni_aio_get_output(nni_aio *, int); +// nni_aio_set_iov sets an IOV (scatter/gather vector) on the AIO. +// Up to 4 may be set without any possibility of failure, more than that +// may require an allocation and hence fail due to NNG_ENOMEM. +extern int nni_aio_set_iov(nni_aio *, int, nng_iov *); + // XXX: These should be refactored in terms of generic inputs and outputs. extern void nni_aio_set_msg(nni_aio *, nni_msg *); extern nni_msg *nni_aio_get_msg(nni_aio *); -- cgit v1.2.3-70-g09d2