libssh2_channel_get_exit_signal(3)
β¨ libssh2_channel_get_exit_signal β¨
okay bestie, so this is a page from the libssh2 manual set, and today we're decoding libssh2_channel_get_exit_signal(3) β the little function that tells you why your remote program ghosted you π«Ά
πΈ NAME πΈ
libssh2_channel_get_exit_signal β get the remote exit signal π
π¦ SYNOPSIS π¦
#include <libssh2.h>
int
libssh2_channel_get_exit_signal(LIBSSH2_CHANNEL *channel,
char **exitsignal, size_t *exitsignal_len,
char **errmsg, size_t *errmsg_len,
char **langtag, size_t *langtag_len);
π DESCRIPTION π
Okay so picture this: you got a channel, it's closed, and you're dying to know what happened on the other end. That's literally this function's whole job. Let's go through the cast one by one π
channelβ the closed channel stream you wanna pull the exit signal from. it's giving "closed casket but we still need answers" π΅οΈexitsignalβ if it's notNULL, this gets populated by reference with the exit signal β and no cap, it comes without the leading"SIG"π« so it's notSIGTERM, it's justTERM. Also heads up: the string lives in a newly allocated buffer, so that's yours to manage now. And if the remote program exited cleanly? The referenced string pointer gets set toNULL. Clean exit, clean conscience, no drama β¨exitsignal_lenβ if it's notNULL, this gets populated by reference with the length ofexitsignal. so you know exactly how long your little string bestie is πerrmsgβ if it's notNULL, this gets populated by reference with the error message β if the remote server provided one. If it didn't, it gets set toNULLπ and again, this string is stored in a newly allocated buffer.errmsg_lenβ if it's notNULL, this gets populated by reference with the length oferrmsg. slay.langtagβ if it's notNULL, this gets populated by reference with the language tag β if the remote server provided one, otherwise it'sNULLπ and yes, once more with feeling: the string is stored in a newly allocated buffer.langtag_lenβ if it's notNULL, this gets populated by reference with the length oflangtag. iconic, consistent, we love a full set π
fr fr, remember:exitsignal,errmsgandlangtagare all freshly allocated buffers when they get filled in. That's not a vibe you forget about, that's a vibe you free π
β RETURN VALUE β
It returns a numeric error code that corresponds to the Error Code constants. so like, check your constants, bestie π
that's the whole page, periodt π
this was libssh2_channel_get_exit_signal(3) from the libssh2 man pages, version 1.2.8, dated 4 Oct 2010 β yes she's vintage, yes she still ate, no notes ππβ¨
π¦ 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