1 .\" $OpenBSD: ERR_get_error.3,v 1.4 2016/11/23 17:59:29 schwarze Exp $
2 .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
4 .\" This file was written by Ulf Moeller <ulf@openssl.org>.
5 .\" Copyright (c) 2000, 2002, 2014 The OpenSSL Project. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in
16 .\" the documentation and/or other materials provided with the
19 .\" 3. All advertising materials mentioning features or use of this
20 .\" software must display the following acknowledgment:
21 .\" "This product includes software developed by the OpenSSL Project
22 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\" endorse or promote products derived from this software without
26 .\" prior written permission. For written permission, please contact
27 .\" openssl-core@openssl.org.
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\" nor may "OpenSSL" appear in their names without prior written
31 .\" permission of the OpenSSL Project.
33 .\" 6. Redistributions of any form whatsoever must retain the following
35 .\" "This product includes software developed by the OpenSSL Project
36 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
51 .Dd $Mdocdate: November 23 2016 $
57 .Nm ERR_peek_last_error ,
58 .Nm ERR_get_error_line ,
59 .Nm ERR_peek_error_line ,
60 .Nm ERR_peek_last_error_line ,
61 .Nm ERR_get_error_line_data ,
62 .Nm ERR_peek_error_line_data ,
63 .Nm ERR_peek_last_error_line_data
64 .Nd obtain OpenSSL error code and data
68 .Fn ERR_get_error void
70 .Fn ERR_peek_error void
72 .Fn ERR_peek_last_error void
74 .Fo ERR_get_error_line
75 .Fa "const char **file"
79 .Fo ERR_peek_error_line
80 .Fa "const char **file"
84 .Fo ERR_peek_last_error_line
85 .Fa "const char **file"
89 .Fo ERR_get_error_line_data
90 .Fa "const char **file"
92 .Fa "const char **data"
96 .Fo ERR_peek_error_line_data
97 .Fa "const char **file"
99 .Fa "const char **data"
103 .Fo ERR_peek_last_error_line_data
104 .Fa "const char **file"
106 .Fa "const char **data"
111 returns the earliest error code from the thread's error queue and
113 This function can be called repeatedly until there are no more error
117 returns the earliest error code from the thread's error queue without
120 .Fn ERR_peek_last_error
121 returns the latest error code from the thread's error queue without
126 for obtaining information about the location and reason for the error, and
127 .Xr ERR_error_string 3
128 for human-readable error messages.
130 .Fn ERR_get_error_line ,
131 .Fn ERR_peek_error_line ,
133 .Fn ERR_peek_last_error_line
134 are the same as the above, but they additionally store the file name and
135 line number where the error occurred in
142 .Fn ERR_get_error_line_data ,
143 .Fn ERR_peek_error_line_data ,
145 .Fn ERR_peek_last_error_line_data
146 store additional data and flags associated with the error code in
154 .Pf * Fa flags Ns & Ns Dv ERR_TXT_STRING
161 pointer (or any other pointers returned by these functions) with
163 as freeing is handled automatically by the error library.
165 The error code, or 0 if there is no error in the queue.
168 .Xr ERR_error_string 3 ,
173 .Fn ERR_get_error_line ,
175 .Fn ERR_peek_error_line
176 are available in all versions of SSLeay and OpenSSL.
177 .Fn ERR_get_error_line_data
179 .Fn ERR_peek_error_line_data
180 were added in SSLeay 0.9.0.
181 .Fn ERR_peek_last_error ,
182 .Fn ERR_peek_last_error_line ,
184 .Fn ERR_peek_last_error_line_data
185 were added in OpenSSL 0.9.7.