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 agnutls_session_ttype. that's it. that's the vibe.int errβ the error value you wanna store in the session-specificerrnovariable. π
β¨ 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 π«Ά
- Report bugs to
<bugs@gnutls.org>. - Home page:
https://www.gnutls.org
β¨ COPYRIGHT β¨
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms