diff options
Diffstat (limited to 'src/lib/libcrypto/man/ERR_get_error.3')
| -rw-r--r-- | src/lib/libcrypto/man/ERR_get_error.3 | 135 |
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 | ||
| 61 | returns the earliest error code from the thread's error queue and | ||
| 62 | removes the entry. | ||
| 63 | This function can be called repeatedly until there are no more error | ||
| 64 | codes to return. | ||
| 65 | .Pp | ||
| 66 | .Fn ERR_peek_error | ||
| 67 | returns the earliest error code from the thread's error queue without | ||
| 68 | modifying it. | ||
| 69 | .Pp | ||
| 70 | .Fn ERR_peek_last_error | ||
| 71 | returns the latest error code from the thread's error queue without | ||
| 72 | modifying it. | ||
| 73 | .Pp | ||
| 74 | See | ||
| 75 | .Xr ERR_GET_LIB 3 | ||
| 76 | for obtaining information about location and reason of the error, and | ||
| 77 | .Xr ERR_error_string 3 | ||
| 78 | for human-readable error messages. | ||
| 79 | .Pp | ||
| 80 | .Fn ERR_get_error_line , | ||
| 81 | .Fn ERR_peek_error_line , | ||
| 82 | and | ||
| 83 | .Fn ERR_peek_last_error_line | ||
| 84 | are the same as the above, but they additionally store the file name and | ||
| 85 | line number where the error occurred in | ||
| 86 | .Pf * Fa file | ||
| 87 | and | ||
| 88 | .Pf * Fa line , | ||
| 89 | unless these are | ||
| 90 | .Dv NULL . | ||
| 91 | .Pp | ||
| 92 | .Fn ERR_get_error_line_data , | ||
| 93 | .Fn ERR_peek_error_line_data , | ||
| 94 | and | ||
| 95 | .Fn ERR_peek_last_error_line_data | ||
| 96 | store additional data and flags associated with the error code in | ||
| 97 | .Pf * Fa data | ||
| 98 | and | ||
| 99 | .Pf * Fa flags , | ||
| 100 | unless these are | ||
| 101 | .Dv NULL . | ||
| 102 | .Pf * Fa data | ||
| 103 | contains a string if | ||
| 104 | .Pf * Fa flags Ns & Ns Dv ERR_TXT_STRING | ||
| 105 | is true. | ||
| 106 | .Pp | ||
| 107 | An application | ||
| 108 | .Sy MUST NOT | ||
| 109 | free the | ||
| 110 | .Pf * Fa data | ||
| 111 | pointer (or any other pointers returned by these functions) with | ||
| 112 | .Xr free 3 | ||
| 113 | as freeing is handled automatically by the error library. | ||
| 114 | .Sh RETURN VALUES | ||
| 115 | The 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 , | ||
| 124 | and | ||
| 125 | .Fn ERR_peek_error_line | ||
| 126 | are available in all versions of SSLeay and OpenSSL. | ||
| 127 | .Fn ERR_get_error_line_data | ||
| 128 | and | ||
| 129 | .Fn ERR_peek_error_line_data | ||
| 130 | were added in SSLeay 0.9.0. | ||
| 131 | .Fn ERR_peek_last_error , | ||
| 132 | .Fn ERR_peek_last_error_line , | ||
| 133 | and | ||
| 134 | .Fn ERR_peek_last_error_line_data | ||
| 135 | were added in OpenSSL 0.9.7. | ||
