xref: /minix3/crypto/external/bsd/openssl/dist/doc/crypto/ERR_GET_LIB.pod (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc=pod
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambuc=head1 NAME
4*ebfedea0SLionel Sambuc
5*ebfedea0SLionel SambucERR_GET_LIB, ERR_GET_FUNC, ERR_GET_REASON - get library, function and
6*ebfedea0SLionel Sambucreason code
7*ebfedea0SLionel Sambuc
8*ebfedea0SLionel Sambuc=head1 SYNOPSIS
9*ebfedea0SLionel Sambuc
10*ebfedea0SLionel Sambuc #include <openssl/err.h>
11*ebfedea0SLionel Sambuc
12*ebfedea0SLionel Sambuc int ERR_GET_LIB(unsigned long e);
13*ebfedea0SLionel Sambuc
14*ebfedea0SLionel Sambuc int ERR_GET_FUNC(unsigned long e);
15*ebfedea0SLionel Sambuc
16*ebfedea0SLionel Sambuc int ERR_GET_REASON(unsigned long e);
17*ebfedea0SLionel Sambuc
18*ebfedea0SLionel Sambuc=head1 DESCRIPTION
19*ebfedea0SLionel Sambuc
20*ebfedea0SLionel SambucThe error code returned by ERR_get_error() consists of a library
21*ebfedea0SLionel Sambucnumber, function code and reason code. ERR_GET_LIB(), ERR_GET_FUNC()
22*ebfedea0SLionel Sambucand ERR_GET_REASON() can be used to extract these.
23*ebfedea0SLionel Sambuc
24*ebfedea0SLionel SambucThe library number and function code describe where the error
25*ebfedea0SLionel Sambucoccurred, the reason code is the information about what went wrong.
26*ebfedea0SLionel Sambuc
27*ebfedea0SLionel SambucEach sub-library of OpenSSL has a unique library number; function and
28*ebfedea0SLionel Sambucreason codes are unique within each sub-library.  Note that different
29*ebfedea0SLionel Sambuclibraries may use the same value to signal different functions and
30*ebfedea0SLionel Sambucreasons.
31*ebfedea0SLionel Sambuc
32*ebfedea0SLionel SambucB<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally
33*ebfedea0SLionel Sambucunique. However, when checking for sub-library specific reason codes,
34*ebfedea0SLionel Sambucbe sure to also compare the library number.
35*ebfedea0SLionel Sambuc
36*ebfedea0SLionel SambucERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are macros.
37*ebfedea0SLionel Sambuc
38*ebfedea0SLionel Sambuc=head1 RETURN VALUES
39*ebfedea0SLionel Sambuc
40*ebfedea0SLionel SambucThe library number, function code and reason code respectively.
41*ebfedea0SLionel Sambuc
42*ebfedea0SLionel Sambuc=head1 SEE ALSO
43*ebfedea0SLionel Sambuc
44*ebfedea0SLionel SambucL<err(3)|err(3)>, L<ERR_get_error(3)|ERR_get_error(3)>
45*ebfedea0SLionel Sambuc
46*ebfedea0SLionel Sambuc=head1 HISTORY
47*ebfedea0SLionel Sambuc
48*ebfedea0SLionel SambucERR_GET_LIB(), ERR_GET_FUNC() and ERR_GET_REASON() are available in
49*ebfedea0SLionel Sambucall versions of SSLeay and OpenSSL.
50*ebfedea0SLionel Sambuc
51*ebfedea0SLionel Sambuc=cut
52