1ERR_get_error(3) OpenSSL ERR_get_error(3)
2
3
4
6 ERR_get_error, ERR_peek_error, ERR_peek_last_error, ERR_get_error_line,
7 ERR_peek_error_line, ERR_peek_last_error_line, ERR_get_error_line_data,
8 ERR_peek_error_line_data, ERR_peek_last_error_line_data - obtain error
9 code and data
10
12 #include <openssl/err.h>
13
14 unsigned long ERR_get_error(void);
15 unsigned long ERR_peek_error(void);
16 unsigned long ERR_peek_last_error(void);
17
18 unsigned long ERR_get_error_line(const char **file, int *line);
19 unsigned long ERR_peek_error_line(const char **file, int *line);
20 unsigned long ERR_peek_last_error_line(const char **file, int *line);
21
22 unsigned long ERR_get_error_line_data(const char **file, int *line,
23 const char **data, int *flags);
24 unsigned long ERR_peek_error_line_data(const char **file, int *line,
25 const char **data, int *flags);
26 unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
27 const char **data, int *flags);
28
30 ERR_get_error() returns the earliest error code from the thread's error
31 queue and removes the entry. This function can be called repeatedly
32 until there are no more error codes to return.
33
34 ERR_peek_error() returns the earliest error code from the thread's
35 error queue without modifying it.
36
37 ERR_peek_last_error() returns the latest error code from the thread's
38 error queue without modifying it.
39
40 See ERR_GET_LIB(3) for obtaining information about location and reason
41 of the error, and ERR_error_string(3) for human-readable error
42 messages.
43
44 ERR_get_error_line(), ERR_peek_error_line() and
45 ERR_peek_last_error_line() are the same as the above, but they
46 additionally store the file name and line number where the error
47 occurred in *file and *line, unless these are NULL.
48
49 ERR_get_error_line_data(), ERR_peek_error_line_data() and
50 ERR_peek_last_error_line_data() store additional data and flags
51 associated with the error code in *data and *flags, unless these are
52 NULL. *data contains a string if *flags&ERR_TXT_STRING is true.
53
54 An application MUST NOT free the *data pointer (or any other pointers
55 returned by these functions) with OPENSSL_free() as freeing is handled
56 automatically by the error library.
57
59 The error code, or 0 if there is no error in the queue.
60
62 err(3), ERR_error_string(3), ERR_GET_LIB(3)
63
65 ERR_get_error(), ERR_peek_error(), ERR_get_error_line() and
66 ERR_peek_error_line() are available in all versions of SSLeay and
67 OpenSSL. ERR_get_error_line_data() and ERR_peek_error_line_data() were
68 added in SSLeay 0.9.0. ERR_peek_last_error(),
69 ERR_peek_last_error_line() and ERR_peek_last_error_line_data() were
70 added in OpenSSL 0.9.7.
71
72
73
741.0.2o 2018-03-27 ERR_get_error(3)