libssh2_channel_get_exit_signal(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 not NULL, this gets populated by reference with the exit signal β€” and no cap, it comes without the leading "SIG" 🚫 so it's not SIGTERM, it's just TERM. 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 to NULL. Clean exit, clean conscience, no drama ✨
  • exitsignal_len β€” if it's not NULL, this gets populated by reference with the length of exitsignal. so you know exactly how long your little string bestie is πŸ“
  • errmsg β€” if it's not NULL, this gets populated by reference with the error message β€” if the remote server provided one. If it didn't, it gets set to NULL 😭 and again, this string is stored in a newly allocated buffer.
  • errmsg_len β€” if it's not NULL, this gets populated by reference with the length of errmsg. slay.
  • langtag β€” if it's not NULL, this gets populated by reference with the language tag β€” if the remote server provided one, otherwise it's NULL πŸ™ˆ and yes, once more with feeling: the string is stored in a newly allocated buffer.
  • langtag_len β€” if it's not NULL, this gets populated by reference with the length of langtag. iconic, consistent, we love a full set πŸ’…
fr fr, remember: exitsignal, errmsg and langtag are 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 πŸŒˆπŸŽ€βœ¨