1*4724848cSchristos=pod 2*4724848cSchristos 3*4724848cSchristos=head1 NAME 4*4724848cSchristos 5*4724848cSchristosERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON, ERR_FATAL_ERROR 6*4724848cSchristos- get information from error codes 7*4724848cSchristos 8*4724848cSchristos=head1 SYNOPSIS 9*4724848cSchristos 10*4724848cSchristos #include <openssl/err.h> 11*4724848cSchristos 12*4724848cSchristos int ERR_GET_LIB(unsigned long e); 13*4724848cSchristos 14*4724848cSchristos int ERR_GET_FUNC(unsigned long e); 15*4724848cSchristos 16*4724848cSchristos int ERR_GET_REASON(unsigned long e); 17*4724848cSchristos 18*4724848cSchristos int ERR_FATAL_ERROR(unsigned long e); 19*4724848cSchristos 20*4724848cSchristos=head1 DESCRIPTION 21*4724848cSchristos 22*4724848cSchristosThe error code returned by ERR_get_error() consists of a library 23*4724848cSchristosnumber, function code and reason code. ERR_GET_LIB(), ERR_GET_FUNC() 24*4724848cSchristosand ERR_GET_REASON() can be used to extract these. 25*4724848cSchristos 26*4724848cSchristosERR_FATAL_ERROR() indicates whether a given error code is a fatal error. 27*4724848cSchristos 28*4724848cSchristosThe library number and function code describe where the error 29*4724848cSchristosoccurred, the reason code is the information about what went wrong. 30*4724848cSchristos 31*4724848cSchristosEach sub-library of OpenSSL has a unique library number; function and 32*4724848cSchristosreason codes are unique within each sub-library. Note that different 33*4724848cSchristoslibraries may use the same value to signal different functions and 34*4724848cSchristosreasons. 35*4724848cSchristos 36*4724848cSchristosB<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally 37*4724848cSchristosunique. However, when checking for sub-library specific reason codes, 38*4724848cSchristosbe sure to also compare the library number. 39*4724848cSchristos 40*4724848cSchristosERR_GET_LIB(), ERR_GET_FUNC(), ERR_GET_REASON(), and ERR_FATAL_ERROR() 41*4724848cSchristos are macros. 42*4724848cSchristos 43*4724848cSchristos=head1 RETURN VALUES 44*4724848cSchristos 45*4724848cSchristosThe library number, function code, reason code, and whether the error 46*4724848cSchristosis fatal, respectively. 47*4724848cSchristos 48*4724848cSchristos=head1 SEE ALSO 49*4724848cSchristos 50*4724848cSchristosL<ERR_get_error(3)> 51*4724848cSchristos 52*4724848cSchristos=head1 HISTORY 53*4724848cSchristos 54*4724848cSchristosERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are available in 55*4724848cSchristosall versions of OpenSSL. 56*4724848cSchristos 57*4724848cSchristos=head1 COPYRIGHT 58*4724848cSchristos 59*4724848cSchristosCopyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. 60*4724848cSchristos 61*4724848cSchristosLicensed under the OpenSSL license (the "License"). You may not use 62*4724848cSchristosthis file except in compliance with the License. You can obtain a copy 63*4724848cSchristosin the file LICENSE in the source distribution or at 64*4724848cSchristosL<https://www.openssl.org/source/license.html>. 65*4724848cSchristos 66*4724848cSchristos=cut 67