X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Finclude%2Futils%2Fchannel.h;h=49d37fdcfec6ec6d87df83697a382fa243b48575;hp=e1b3f0e63e695f83b4ebf5d64671bf181920ff2f;hb=cd2c02cefddee94e0142a8f1d3d156c05c58472a;hpb=bed406a8fce9eb683059a3138dd33e4cf7bd71cd diff --git a/src/include/utils/channel.h b/src/include/utils/channel.h index e1b3f0e..49d37fd 100644 --- a/src/include/utils/channel.h +++ b/src/include/utils/channel.h @@ -108,6 +108,18 @@ int sdb_channel_select(sdb_channel_t *chan, int *wantread, void *read_data, int *wantwrite, void *write_data, const struct timespec *timeout); +/* sdb_channel_shutdown: + * Initiate a shutdown of the channel. Any subsequent writes will fail. Read + * operations will still be possible until the channel buffer is empty and + * then fail as well. Failing operations set errno to EBADF. + * + * Returns: + * - 0 on success + * - a negative value else + */ +int +sdb_channel_shutdown(sdb_channel_t *chan); + #ifdef __cplusplus } /* extern "C" */ #endif