diff options
Diffstat (limited to 'src/lib/libcrypto/man/ERR.3')
| -rw-r--r-- | src/lib/libcrypto/man/ERR.3 | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/lib/libcrypto/man/ERR.3 b/src/lib/libcrypto/man/ERR.3 index b788942c4c..6818a1cf46 100644 --- a/src/lib/libcrypto/man/ERR.3 +++ b/src/lib/libcrypto/man/ERR.3 | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | .\" $OpenBSD: ERR.3,v 1.3 2016/11/06 16:12:53 schwarze Exp $ | 1 | .\" $OpenBSD: ERR.3,v 1.4 2016/11/17 21:06:16 jmc Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 17 2016 $ |
| 4 | .Dt ERR 3 | 4 | .Dt ERR 3 |
| 5 | .Os | 5 | .Os |
| 6 | .Sh NAME | 6 | .Sh NAME |
| @@ -46,11 +46,11 @@ Each sub-library has a specific macro | |||
| 46 | .Fn XXXerr f r | 46 | .Fn XXXerr f r |
| 47 | that is used to report errors. | 47 | that is used to report errors. |
| 48 | Its first argument is a function code | 48 | Its first argument is a function code |
| 49 | .Dv XXX_F_* , | 49 | .Dv XXX_F_* ; |
| 50 | the second argument is a reason code | 50 | the second argument is a reason code |
| 51 | .Dv XXX_R_* . | 51 | .Dv XXX_R_* . |
| 52 | Function codes are derived from the function names; reason codes consist | 52 | Function codes are derived from the function names |
| 53 | of textual error descriptions. | 53 | whereas reason codes consist of textual error descriptions. |
| 54 | For example, the function | 54 | For example, the function |
| 55 | .Fn ssl23_read | 55 | .Fn ssl23_read |
| 56 | reports a "handshake failure" as follows: | 56 | reports a "handshake failure" as follows: |
| @@ -60,8 +60,8 @@ reports a "handshake failure" as follows: | |||
| 60 | Function and reason codes should consist of upper case characters, | 60 | Function and reason codes should consist of upper case characters, |
| 61 | numbers and underscores only. | 61 | numbers and underscores only. |
| 62 | The error file generation script translates function codes into function | 62 | The error file generation script translates function codes into function |
| 63 | names by looking in the header files for an appropriate function name, | 63 | names by looking in the header files for an appropriate function name. |
| 64 | if none is found it just uses the capitalized form such as "SSL23_READ" | 64 | If none is found it just uses the capitalized form such as "SSL23_READ" |
| 65 | in the above example. | 65 | in the above example. |
| 66 | .Pp | 66 | .Pp |
| 67 | The trailing section of a reason code (after the "_R_") is translated | 67 | The trailing section of a reason code (after the "_R_") is translated |
| @@ -76,7 +76,7 @@ will then automatically be added to the sub-library's header file. | |||
| 76 | Although a library will normally report errors using its own specific | 76 | Although a library will normally report errors using its own specific |
| 77 | .Fn XXXerr | 77 | .Fn XXXerr |
| 78 | macro, another library's macro can be used. | 78 | macro, another library's macro can be used. |
| 79 | This is normally only done when a library wants to include ASN1 code | 79 | This is normally only done when a library wants to include ASN.1 code |
| 80 | which must use the | 80 | which must use the |
| 81 | .Fn ASN1err | 81 | .Fn ASN1err |
| 82 | macro. | 82 | macro. |
| @@ -137,8 +137,8 @@ extern "C" { | |||
| 137 | The | 137 | The |
| 138 | .Sy BEGIN ERROR CODES | 138 | .Sy BEGIN ERROR CODES |
| 139 | sequence is used by the error code generation script as the point to | 139 | sequence is used by the error code generation script as the point to |
| 140 | place new error codes, any text after this point will be overwritten | 140 | place new error codes. |
| 141 | when | 141 | Any text after this point will be overwritten when |
| 142 | .Sy make errors | 142 | .Sy make errors |
| 143 | is run. | 143 | is run. |
| 144 | The closing #endif etc. will be automatically added by the script. | 144 | The closing #endif etc. will be automatically added by the script. |
| @@ -161,12 +161,12 @@ insertion script | |||
| 161 | explicitly to add codes to the header file and generate the C error code | 161 | explicitly to add codes to the header file and generate the C error code |
| 162 | file. | 162 | file. |
| 163 | This will normally be done if the external library needs to generate new | 163 | This will normally be done if the external library needs to generate new |
| 164 | ASN1 structures but it can also be used to add more general purpose | 164 | ASN.1 structures but it can also be used to add more general purpose |
| 165 | error code handling. | 165 | error code handling. |
| 166 | .Sh INTERNALS | 166 | .Sh INTERNALS |
| 167 | The error queues are stored in a hash table with one | 167 | The error queues are stored in a hash table with one |
| 168 | .Vt ERR_STATE | 168 | .Vt ERR_STATE |
| 169 | entry for each pid. | 169 | entry for each PID. |
| 170 | .Fn ERR_get_state | 170 | .Fn ERR_get_state |
| 171 | returns the current thread's | 171 | returns the current thread's |
| 172 | .Vt ERR_STATE . | 172 | .Vt ERR_STATE . |
| @@ -178,13 +178,12 @@ error codes. | |||
| 178 | When more error codes are added, the old ones are overwritten, on the | 178 | When more error codes are added, the old ones are overwritten, on the |
| 179 | assumption that the most recent errors are most important. | 179 | assumption that the most recent errors are most important. |
| 180 | .Pp | 180 | .Pp |
| 181 | Error strings are also stored in hash table. | 181 | Error strings are also stored in a hash table. |
| 182 | The hash tables can be obtained by calling | 182 | The hash tables can be obtained by calling |
| 183 | .Fn ERR_get_err_state_table | 183 | .Fn ERR_get_err_state_table |
| 184 | and | 184 | and |
| 185 | .Fn ERR_get_string_table . | 185 | .Fn ERR_get_string_table . |
| 186 | .Sh SEE ALSO | 186 | .Sh SEE ALSO |
| 187 | .Xr CRYPTO_set_id_callback 3 , | ||
| 188 | .Xr CRYPTO_set_locking_callback 3 , | 187 | .Xr CRYPTO_set_locking_callback 3 , |
| 189 | .Xr ERR_clear_error 3 , | 188 | .Xr ERR_clear_error 3 , |
| 190 | .Xr ERR_error_string 3 , | 189 | .Xr ERR_error_string 3 , |
