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