gnutls_transport_set_errno(3)

πŸ’– gnutls_transport_set_errno(3) πŸ’–

okay bestie, we're in the gnutls manual and this page is literally about telling your session what went wrong. let's go πŸ¦‹


✨ NAME ✨

gnutls_transport_set_errno β€” the API function that stores an error value in your session's very own errno. periodt.


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

void gnutls_transport_set_errno(gnutls_session_t session, int err);

✨ ARGUMENTS ✨

  • gnutls_session_t session β€” bestie this is a gnutls_session_t type. that's it. that's the vibe.
  • int err β€” the error value you wanna store in the session-specific errno variable. πŸ‘‘

✨ DESCRIPTION ✨

So what it does: it stores err in the session-specific errno variable.

The useful values for err are EINTR, EAGAIN and EMSGSIZE β€” those are the ones you actually want, iykyk. Every other value gets treated as a real error in the push/pull function. so like, don't just yeet random numbers in there, fr fr. 😭

This function is highkey useful in replacement push and pull functions β€” the ones you set with gnutls_transport_set_push_function() and gnutls_transport_set_pull_function() β€” specifically under Windows, where your replacements might not have access to the same errno variable that GnuTLS is using. like, picture this: the application is linked to msvcr71.dll and gnutls is linked to msvcrt.dll. different errnos, different vibes, whole mess. πŸ’€ that's the exact scenario this function exists for.

⚠️ real talk though: this function is unreliable if you're using the same session in different threads for sending and receiving. don't do that. it's giving chaos. πŸ™ˆ

✨ REPORTING BUGS ✨

Found a bug? tell the devs, they wanna know 🫢


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. slay, and also legally binding ✨


✨ SEE ALSO ✨

The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/

go read it, it's iconic πŸ‘‘


and that's the whole page, bestie! πŸŽ€ this one came from gnutls 3.8.13 β€” mwah, love u, go set some errnos responsibly πŸ’…πŸŒΈ

πŸ“¦ where this page comes from