ERR_LOAD_STRINGS(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’– ERR_LOAD_STRINGS(3) πŸ’–

okay bestie, welcome to the Library Functions Manual entry for ERR_LOAD_STRINGS(3) β€” this one is all about loading arbitrary OpenSSL error strings, and it’s lowkey iconic for that. πŸ¦‹


🌸 NAME 🌸

ERR_load_strings, ERR_PACK, ERR_get_next_error_library β€” load arbitrary OpenSSL error strings

✨ SYNOPSIS ✨

library β€œlibcrypto” #include <openssl/err.h>

void
ERR_load_strings(int lib, ERR_STRING_DATA str[]);

unsigned long
ERR_PACK(int lib, int func, int reason);

int
ERR_get_next_error_library(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, ERR_load_strings() registers error strings for library number lib. slay.

str is an array of error string data:

typedef struct ERR_string_data_st {
        unsigned long error;
        char *string;
} ERR_STRING_DATA;

The error code is generated from the library number and a function and reason code:

error = ERR_PACK(lib, func, reason)

ERR_PACK() is a macro. periodt.

The last entry in the array is {0, NULL}. no cap, that’s the little end marker vibe.

ERR_get_next_error_library() can be used to assign library numbers to user libraries at runtime. it’s giving β€œgrab a fresh number bestie” energy. πŸ’…

πŸ’… RETURN VALUES πŸ’…

ERR_PACK() returns the error code. ERR_get_next_error_library() returns a new library number. fr fr, that’s the whole return-value situation.

πŸŽ€ SEE ALSO πŸŽ€

  • ERR(3) β€” yes bestie, go read that one too.

πŸ‘‘ HISTORY πŸ‘‘

ERR_load_strings() and ERR_PACK() first appeared in SSLeay 0.4.4. ERR_get_next_error_library() first appeared in SSLeay 0.9.0. These functions have been available since OpenBSD 2.4. not me being obsessed with a clean little timeline. ⭐


mwah πŸ’‹ β€” source/version Debian, date June 8, 2025, page ERR_LOAD_STRINGS(3). πŸŽ€

πŸ“¦ where this page comes from