diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-12 14:43:31 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-12 14:43:31 -0800 |
| commit | 2ddaecdadb8a931188b3f3e6b8ad43b9cba45d0f (patch) | |
| tree | ddab0fbc8bb631fc31c233e09cd83a561988158d /src/core/aio.h | |
| parent | d88484cafbf973d55dc95b7edcae5064efa8bad0 (diff) | |
| download | nng-2ddaecdadb8a931188b3f3e6b8ad43b9cba45d0f.tar.gz nng-2ddaecdadb8a931188b3f3e6b8ad43b9cba45d0f.tar.bz2 nng-2ddaecdadb8a931188b3f3e6b8ad43b9cba45d0f.zip | |
api: extend usage of nng_err
This replaces the int, and we will expand this further, as this
makes it clear that the int is actually an error code and helps in
debuggers that can provide symbolic values.
Diffstat (limited to 'src/core/aio.h')
| -rw-r--r-- | src/core/aio.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/aio.h b/src/core/aio.h index cbf2c919..25475323 100644 --- a/src/core/aio.h +++ b/src/core/aio.h @@ -85,7 +85,7 @@ extern nni_msg *nni_aio_get_msg(nni_aio *); // for the operation. It is only valid to call this when the operation is // complete (such as when the callback is executed or after nni_aio_wait // is performed). -extern int nni_aio_result(nni_aio *); +extern nng_err nni_aio_result(nni_aio *); // nni_aio_count returns the number of bytes of data transferred, if any. // As with nni_aio_result, it is only defined if the I/O operation has @@ -114,19 +114,19 @@ extern void nni_aio_list_remove(nni_aio *); extern int nni_aio_list_active(nni_aio *); // nni_aio_finish is called by the provider when an operation is complete. -extern void nni_aio_finish(nni_aio *, int, size_t); +extern void nni_aio_finish(nni_aio *, nng_err, size_t); // nni_aio_finish_sync is to be called when a synchronous completion is // desired. It is very important that the caller not hold any locks when // calling this, but it is useful for chaining completions to minimize // context switch overhead during completions. -extern void nni_aio_finish_sync(nni_aio *, int, size_t); -extern void nni_aio_finish_error(nni_aio *, int); +extern void nni_aio_finish_sync(nni_aio *, nng_err, size_t); +extern void nni_aio_finish_error(nni_aio *, nng_err); extern void nni_aio_finish_msg(nni_aio *, nni_msg *); // nni_aio_abort is used to abort an operation. Any pending I/O or // timeouts are canceled if possible, and the callback will be returned // with the indicated result (NNG_ECLOSED or NNG_ECANCELED is recommended.) -extern void nni_aio_abort(nni_aio *, int rv); +extern void nni_aio_abort(nni_aio *, nng_err); extern void *nni_aio_get_prov_data(nni_aio *); extern void nni_aio_set_prov_data(nni_aio *, void *); @@ -186,7 +186,7 @@ extern void nni_aio_completions_run(nni_aio_completions *); // appropriate) to the completion list. This should be done while the // appropriate lock is held. The aio must not be scheduled. extern void nni_aio_completions_add( - nni_aio_completions *, nni_aio *, int, size_t); + nni_aio_completions *, nni_aio *, nng_err, size_t); extern int nni_aio_sys_init(nng_init_params *); extern bool nni_aio_sys_drain(void); @@ -206,7 +206,7 @@ struct nng_aio { size_t a_count; // Bytes transferred (I/O only) nni_time a_expire; // Absolute timeout nni_duration a_timeout; // Relative timeout - int a_result; // Result code (nng_errno) + nng_err a_result; // Result code (nng_errno) bool a_stop; // Shutting down (no new operations) bool a_sleep; // Sleeping with no action bool a_expire_ok; // Expire from sleep is ok |
