summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ERR_get_error.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/ERR_get_error.3')
-rw-r--r--src/lib/libcrypto/man/ERR_get_error.3135
1 files changed, 135 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ERR_get_error.3 b/src/lib/libcrypto/man/ERR_get_error.3
new file mode 100644
index 0000000000..8b11f792c1
--- /dev/null
+++ b/src/lib/libcrypto/man/ERR_get_error.3
@@ -0,0 +1,135 @@
1.Dd $Mdocdate: November 2 2016 $
2.Dt ERR_GET_ERROR 3
3.Os
4.Sh NAME
5.Nm ERR_get_error ,
6.Nm ERR_peek_error ,
7.Nm ERR_peek_last_error ,
8.Nm ERR_get_error_line ,
9.Nm ERR_peek_error_line ,
10.Nm ERR_peek_last_error_line ,
11.Nm ERR_get_error_line_data ,
12.Nm ERR_peek_error_line_data ,
13.Nm ERR_peek_last_error_line_data
14.Nd obtain OpenSSL error code and data
15.Sh SYNOPSIS
16.In openssl/err.h
17.Ft unsigned long
18.Fn ERR_get_error void
19.Ft unsigned long
20.Fn ERR_peek_error void
21.Ft unsigned long
22.Fn ERR_peek_last_error void
23.Ft unsigned long
24.Fo ERR_get_error_line
25.Fa "const char **file"
26.Fa "int *line"
27.Fc
28.Ft unsigned long
29.Fo ERR_peek_error_line
30.Fa "const char **file"
31.Fa "int *line"
32.Fc
33.Ft unsigned long
34.Fo ERR_peek_last_error_line
35.Fa "const char **file"
36.Fa "int *line"
37.Fc
38.Ft unsigned long
39.Fo ERR_get_error_line_data
40.Fa "const char **file"
41.Fa "int *line"
42.Fa "const char **data"
43.Fa "int *flags"
44.Fc
45.Ft unsigned long
46.Fo ERR_peek_error_line_data
47.Fa "const char **file"
48.Fa "int *line"
49.Fa "const char **data"
50.Fa "int *flags"
51.Fc
52.Ft unsigned long
53.Fo ERR_peek_last_error_line_data
54.Fa "const char **file"
55.Fa "int *line"
56.Fa "const char **data"
57.Fa "int *flags"
58.Fc
59.Sh DESCRIPTION
60.Fn ERR_get_error
61returns the earliest error code from the thread's error queue and
62removes the entry.
63This function can be called repeatedly until there are no more error
64codes to return.
65.Pp
66.Fn ERR_peek_error
67returns the earliest error code from the thread's error queue without
68modifying it.
69.Pp
70.Fn ERR_peek_last_error
71returns the latest error code from the thread's error queue without
72modifying it.
73.Pp
74See
75.Xr ERR_GET_LIB 3
76for obtaining information about location and reason of the error, and
77.Xr ERR_error_string 3
78for human-readable error messages.
79.Pp
80.Fn ERR_get_error_line ,
81.Fn ERR_peek_error_line ,
82and
83.Fn ERR_peek_last_error_line
84are the same as the above, but they additionally store the file name and
85line number where the error occurred in
86.Pf * Fa file
87and
88.Pf * Fa line ,
89unless these are
90.Dv NULL .
91.Pp
92.Fn ERR_get_error_line_data ,
93.Fn ERR_peek_error_line_data ,
94and
95.Fn ERR_peek_last_error_line_data
96store additional data and flags associated with the error code in
97.Pf * Fa data
98and
99.Pf * Fa flags ,
100unless these are
101.Dv NULL .
102.Pf * Fa data
103contains a string if
104.Pf * Fa flags Ns & Ns Dv ERR_TXT_STRING
105is true.
106.Pp
107An application
108.Sy MUST NOT
109free the
110.Pf * Fa data
111pointer (or any other pointers returned by these functions) with
112.Xr free 3
113as freeing is handled automatically by the error library.
114.Sh RETURN VALUES
115The error code, or 0 if there is no error in the queue.
116.Sh SEE ALSO
117.Xr ERR 3 ,
118.Xr ERR_error_string 3 ,
119.Xr ERR_GET_LIB 3
120.Sh HISTORY
121.Fn ERR_get_error ,
122.Fn ERR_peek_error ,
123.Fn ERR_get_error_line ,
124and
125.Fn ERR_peek_error_line
126are available in all versions of SSLeay and OpenSSL.
127.Fn ERR_get_error_line_data
128and
129.Fn ERR_peek_error_line_data
130were added in SSLeay 0.9.0.
131.Fn ERR_peek_last_error ,
132.Fn ERR_peek_last_error_line ,
133and
134.Fn ERR_peek_last_error_line_data
135were added in OpenSSL 0.9.7.