1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | ERR_GET_LIB, ERR_GET_REASON, ERR_FATAL_ERROR
|
---|
6 | - get information from error codes
|
---|
7 |
|
---|
8 | =head1 SYNOPSIS
|
---|
9 |
|
---|
10 | #include <openssl/err.h>
|
---|
11 |
|
---|
12 | int ERR_GET_LIB(unsigned long e);
|
---|
13 |
|
---|
14 | int ERR_GET_REASON(unsigned long e);
|
---|
15 |
|
---|
16 | int ERR_FATAL_ERROR(unsigned long e);
|
---|
17 |
|
---|
18 | =head1 DESCRIPTION
|
---|
19 |
|
---|
20 | The error code returned by ERR_get_error() consists of a library
|
---|
21 | number and reason code. ERR_GET_LIB()
|
---|
22 | and ERR_GET_REASON() can be used to extract these.
|
---|
23 |
|
---|
24 | ERR_FATAL_ERROR() indicates whether a given error code is a fatal error.
|
---|
25 |
|
---|
26 | The library number describes where the error
|
---|
27 | occurred, the reason code is the information about what went wrong.
|
---|
28 |
|
---|
29 | Each sub-library of OpenSSL has a unique library number; the
|
---|
30 | reason code is unique within each sub-library. Note that different
|
---|
31 | libraries may use the same value to signal different reasons.
|
---|
32 |
|
---|
33 | B<ERR_R_...> reason codes such as B<ERR_R_MALLOC_FAILURE> are globally
|
---|
34 | unique. However, when checking for sub-library specific reason codes,
|
---|
35 | be sure to also compare the library number.
|
---|
36 |
|
---|
37 | ERR_GET_LIB(), ERR_GET_REASON(), and ERR_FATAL_ERROR() are macros.
|
---|
38 |
|
---|
39 | =head1 RETURN VALUES
|
---|
40 |
|
---|
41 | The library number, reason code, and whether the error
|
---|
42 | is fatal, respectively.
|
---|
43 | Starting with OpenSSL 3.0.0, the function code is always set to zero.
|
---|
44 |
|
---|
45 | =head1 SEE ALSO
|
---|
46 |
|
---|
47 | L<ERR_get_error(3)>
|
---|
48 |
|
---|
49 | =head1 HISTORY
|
---|
50 |
|
---|
51 | ERR_GET_LIB() and ERR_GET_REASON() are available in all versions of OpenSSL.
|
---|
52 |
|
---|
53 | ERR_GET_FUNC() was removed in OpenSSL 3.0.
|
---|
54 |
|
---|
55 | =head1 COPYRIGHT
|
---|
56 |
|
---|
57 | Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
---|
58 |
|
---|
59 | Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
60 | this file except in compliance with the License. You can obtain a copy
|
---|
61 | in the file LICENSE in the source distribution or at
|
---|
62 | L<https://www.openssl.org/source/license.html>.
|
---|
63 |
|
---|
64 | =cut
|
---|