libssh2_knownhost_writefile(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_knownhost_writefile(3) πŸ’–

okay bestie, so this one lives in the libssh2 manual, and it's called libssh2_knownhost_writefile ✨


🌸 NAME 🌸

libssh2_knownhost_writefile β€” write a whole collection of known hosts out to a file, periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libssh2.h>

int
libssh2_knownhost_writefile(LIBSSH2_KNOWNHOSTS *hosts,
                            const char *filename, int type);

πŸ‘‘ DESCRIPTION πŸ‘‘

So like, the whole vibe of this function? It writes all the known hosts to the file you point it at, using whatever file format you asked for. That's it, that's the job 🫢

  • filename β€” literally specifies what filename to create πŸŽ€
  • type β€” tells it what file type it is, and ngl there's only one format supported rn: LIBSSH2_KNOWNHOST_FILE_OPENSSH. That's the only one. The only one. Don't come at me with others 😭

⭐ RETURN VALUE ⭐

It returns a regular libssh2 error code, where negative values are error codes and 0 means success πŸ’– so like, zero is the slay outcome, negative is the "girl what happened" outcome.


🌈 AVAILABILITY 🌈

Added in libssh2 1.2 β€” vintage, but make it iconic ✨


πŸŽ€ SEE ALSO πŸŽ€


mwah πŸ’‹ that's the whole page. this was brought to you by the libssh2 girlies, dated 28 May 2009, and yeah the footer says libssh2 twice, once on each side, because symmetry is self-care πŸ’…βœ¨