1ERR_GET_LIB(3ossl) OpenSSL ERR_GET_LIB(3ossl)
2
3
4
6 ERR_GET_LIB, ERR_GET_REASON, ERR_FATAL_ERROR - get information from
7 error codes
8
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
19 The error code returned by ERR_get_error() consists of a library number
20 and reason code. ERR_GET_LIB() and ERR_GET_REASON() can be used to
21 extract these.
22
23 ERR_FATAL_ERROR() indicates whether a given error code is a fatal
24 error.
25
26 The library number describes where the error occurred, the reason code
27 is the information about what went wrong.
28
29 Each sub-library of OpenSSL has a unique library number; the reason
30 code is unique within each sub-library. Note that different libraries
31 may use the same value to signal different reasons.
32
33 ERR_R_... reason codes such as 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
40 The library number, reason code, and whether the error is fatal,
41 respectively. Starting with OpenSSL 3.0.0, the function code is always
42 set to zero.
43
45 Applications should not make control flow decisions based on specific
46 error codes. Error codes are subject to change at any time (even in
47 patch releases of OpenSSL). A particular error code can only be
48 considered meaningful for control flow decisions if it is explicitly
49 documented as such. New failure codes may still appear at any time.
50
52 ERR_get_error(3)
53
55 ERR_GET_LIB() and ERR_GET_REASON() are available in all versions of
56 OpenSSL.
57
58 ERR_GET_FUNC() was removed in OpenSSL 3.0.
59
61 Copyright 2000-2023 The OpenSSL Project Authors. All Rights Reserved.
62
63 Licensed under the Apache License 2.0 (the "License"). You may not use
64 this file except in compliance with the License. You can obtain a copy
65 in the file LICENSE in the source distribution or at
66 <https://www.openssl.org/source/license.html>.
67
68
69
703.1.1 2023-08-31 ERR_GET_LIB(3ossl)