diff options
Diffstat (limited to 'src/lib/libcrypto/man/ERR_GET_LIB.3')
-rw-r--r-- | src/lib/libcrypto/man/ERR_GET_LIB.3 | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ERR_GET_LIB.3 b/src/lib/libcrypto/man/ERR_GET_LIB.3 new file mode 100644 index 0000000000..9b50ce39e6 --- /dev/null +++ b/src/lib/libcrypto/man/ERR_GET_LIB.3 | |||
@@ -0,0 +1,63 @@ | |||
1 | .Dd $Mdocdate: November 2 2016 $ | ||
2 | .Dt ERR_GET_LIB 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm ERR_GET_LIB , | ||
6 | .Nm ERR_GET_FUNC , | ||
7 | .Nm ERR_GET_REASON | ||
8 | .Nd get library, function and reason codes for OpenSSL errors | ||
9 | .Sh SYNOPSIS | ||
10 | .In openssl/err.h | ||
11 | .Ft int | ||
12 | .Fo ERR_GET_LIB | ||
13 | .Fa "unsigned long e" | ||
14 | .Fc | ||
15 | .Ft int | ||
16 | .Fo ERR_GET_FUNC | ||
17 | .Fa "unsigned long e" | ||
18 | .Fc | ||
19 | .Ft int | ||
20 | .Fo ERR_GET_REASON | ||
21 | .Fa "unsigned long e" | ||
22 | .Fc | ||
23 | .Sh DESCRIPTION | ||
24 | The error code returned by | ||
25 | .Xr ERR_get_error 3 | ||
26 | consists of a library number, function code, and reason code. | ||
27 | .Fn ERR_GET_LIB , | ||
28 | .Fn ERR_GET_FUNC , | ||
29 | and | ||
30 | .Fn ERR_GET_REASON | ||
31 | can be used to extract these. | ||
32 | .Pp | ||
33 | The library number and function code describe where the error occurred, | ||
34 | the reason code is the information about what went wrong. | ||
35 | .Pp | ||
36 | Each sub-library of OpenSSL has a unique library number; function and | ||
37 | reason codes are unique within each sub-library. | ||
38 | Note that different libraries may use the same value to signal different | ||
39 | functions and reasons. | ||
40 | .Pp | ||
41 | .Dv ERR_R_* | ||
42 | reason codes such as | ||
43 | .Dv ERR_R_MALLOC_FAILURE | ||
44 | are globally unique. | ||
45 | However, when checking for sub-library specific reason codes, be sure to | ||
46 | also compare the library number. | ||
47 | .Pp | ||
48 | .Fn ERR_GET_LIB , | ||
49 | .Fn ERR_GET_FUNC , | ||
50 | and | ||
51 | .Fn ERR_GET_REASON | ||
52 | are macros. | ||
53 | .Sh RETURN VALUES | ||
54 | The library number, function code, and reason code, respectively. | ||
55 | .Sh SEE ALSO | ||
56 | .Xr ERR 3 , | ||
57 | .Xr ERR_get_error 3 | ||
58 | .Sh HISTORY | ||
59 | .Fn ERR_GET_LIB , | ||
60 | .Fn ERR_GET_FUNC , | ||
61 | and | ||
62 | .Fn ERR_GET_REASON | ||
63 | are available in all versions of SSLeay and OpenSSL. | ||