libssh2_channel_flush_ex(3)
β¨ NAME β¨
libssh2_channel_flush_ex β bestie, it flushes a channel π
(also living in the libssh2 manual, section 3, if you were wondering where to find her)
πΈ SYNOPSIS πΈ
#include <libssh2.h>
int
libssh2_channel_flush_ex(LIBSSH2_CHANNEL *channel, int streamid);
int
libssh2_channel_flush(LIBSSH2_CHANNEL *channel);
int
libssh2_channel_flush_stderr(LIBSSH2_CHANNEL *channel);
π DESCRIPTION π
okay so, three whole functions, and they're all about dumping the read buffer. iconic.
Here's the tea on the arguments:
channelβ the active channel stream you wanna flush, babes. like, the one that's actually live.streamidβ the specific substream number to flush. and here's the cute part: you can flush whole groups of substreams by passing one of these constants πLIBSSH2_CHANNEL_FLUSH_EXTENDED_DATAβ flushes all the extended data substreams β¨LIBSSH2_CHANNEL_FLUSH_ALLβ flushes literally every substream, all of them, no survivors π«Ά
So what does it actually do? It flushes the read buffer for a given channel instance. that's it, that's the whole vibe. You can flush individual substreams by number, or you can use one of the provided macros if you're feeling fancy. main character choice, honestly.
π₯ RETURN VALUE π₯
It returns the number of bytes flushed π β or a negative number if things went sideways, whichβ¦ π.
Heads up bestie: it returnsLIBSSH2_ERROR_EAGAINwhen it would otherwise block. And yes,LIBSSH2_ERROR_EAGAINis technically a negative number, but it's not really a failure per se. don't panic. she's just saying "not right now" π. vibe check passed, fr fr.
and that's the whole page, no cap. this was libssh2 0.15, dated 1 Jun 2007 β yeah she's an elder but she still slays π. mwah, go flush something π
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms