BIO_PRINTF(3ossl)
π BIO_PRINTF(3ossl) π
okay bestie, welcome to the OpenSSL manual page for BIO_PRINTF, section 3ossl. yes we're reading manpages together now, this is our thing, it's giving study date energy πβ¨
β¨ NAME β¨
BIO_printf, BIO_vprintf, BIO_snprintf, BIO_vsnprintf β formatted output to a BIO π«Ά
πΈ SYNOPSIS πΈ
#include <openssl/bio.h>
int BIO_printf(BIO *bio, const char *format, ...);
int BIO_vprintf(BIO *bio, const char *format, va_list args);
int BIO_snprintf(char *buf, size_t n, const char *format, ...);
int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args);
like. look at her. four little functions and they all just want to format stuff for you π
π¦ DESCRIPTION π¦
BIO_printf()β okay so she's basically the standard Cprintf()function, except the output goes to theBIOyou named,bio, instead of standard output. that's the whole glow-up. and yes, all common format specifiers are supported π₯BIO_vprintf()β same deal but she's thevprintf()vibe you'll find on many platforms: output goes to the specifiedBIO,bio, not standard output. all common format specifiers are supported. the argument listargsis astdargargument list. very demure, veryva_listβ¨BIO_snprintf()β this one exists for platforms that do not have the commonsnprintf()function. she's likesprintf()except the size parameter,n, tells her the size of the output buffer. protective queen, sets boundaries πBIO_vsnprintf()β the way thatBIO_vsnprintf()is toBIO_snprintf()asBIO_vprintf()is toBIO_printf(). that's it that's the relationship, they're matching π«Ά
π RETURN VALUES π
all four functions return the number of bytes written, or -1 on error. periodt.
and for BIO_snprintf() and BIO_vsnprintf() specifically? that -1 includes when the output buffer is too small. she will NOT pretend everything is fine. π
π NOTES π
except whennis0, bothBIO_snprintf()andBIO_vsnprintf()always terminate their output with'\0'. yes, always. this includes the cases where-1is returned β like when there isn't enough space to output the whole string. so even when she's failing she's still null-terminating for you. that's main character energy fr fr π
π COPYRIGHT π
Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page bestie, no notes, ate π β¨
this little icon was brought to you by OpenSSL 3.5.9, dated 2026-09-29, and it lives in BIO_PRINTF(3ossl). mwah, go format something π¦π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms