ERR_GET_LIB(3) — Subroutines
NAME
ERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON − Get library, function and reason code
SYNOPSIS
#include <openssl/err.h>
int ERR_GET_LIB(
unsigned long e ); int ERR_GET_FUNC(
unsigned long e ); int ERR_GET_REASON(
unsigned long e );
DESCRIPTION
The error code returned by the ERR_get_error() function consists of a library number, function code and reason code. The ERR_GET_LIB(), ERR_GET_FUNC(), and ERR_GET_REASON() macros can be used to extract these.
The library number and function code describe where the error occurred. The reason code is the information about what went wrong.
Each sublibrary of OpenSSL has a unique library number; function and reason codes are unique within each sublibrary. Different libraries may use the same value to signal different functions and reasons.
The ERR_R_... reason codes, such as ERR_R_MALLOC_FAILURE, are globally unique. However, when checking for sublibrary specific reason codes, be sure to compare the library number.
RETURN VALUES
These functions return the library number, function code, and reason code respectively.
HISTORY
ERR_GET_LIB(), ERR_GET_FUNC(), and ERR_GET_REASON() are available in all versions of SSLeay and OpenSSL.
SEE ALSO
Functions: err(3), ERR_get_error(3)