summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ERR.3
diff options
context:
space:
mode:
authorjmc <>2016-11-17 21:06:16 +0000
committerjmc <>2016-11-17 21:06:16 +0000
commitc9944c8d48b5197b5d660006e939e59e811e2713 (patch)
tree1fedd70e71c32db5d6e3a032a7ea408effdfe14b /src/lib/libcrypto/man/ERR.3
parent97d8f4f2e9be51170c67b25d8bd287ad57bd0b36 (diff)
downloadopenbsd-c9944c8d48b5197b5d660006e939e59e811e2713.tar.gz
openbsd-c9944c8d48b5197b5d660006e939e59e811e2713.tar.bz2
openbsd-c9944c8d48b5197b5d660006e939e59e811e2713.zip
various cleanup;
Diffstat (limited to 'src/lib/libcrypto/man/ERR.3')
-rw-r--r--src/lib/libcrypto/man/ERR.327
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
47that is used to report errors. 47that is used to report errors.
48Its first argument is a function code 48Its first argument is a function code
49.Dv XXX_F_* , 49.Dv XXX_F_* ;
50the second argument is a reason code 50the second argument is a reason code
51.Dv XXX_R_* . 51.Dv XXX_R_* .
52Function codes are derived from the function names; reason codes consist 52Function codes are derived from the function names
53of textual error descriptions. 53whereas reason codes consist of textual error descriptions.
54For example, the function 54For example, the function
55.Fn ssl23_read 55.Fn ssl23_read
56reports a "handshake failure" as follows: 56reports a "handshake failure" as follows:
@@ -60,8 +60,8 @@ reports a "handshake failure" as follows:
60Function and reason codes should consist of upper case characters, 60Function and reason codes should consist of upper case characters,
61numbers and underscores only. 61numbers and underscores only.
62The error file generation script translates function codes into function 62The error file generation script translates function codes into function
63names by looking in the header files for an appropriate function name, 63names by looking in the header files for an appropriate function name.
64if none is found it just uses the capitalized form such as "SSL23_READ" 64If none is found it just uses the capitalized form such as "SSL23_READ"
65in the above example. 65in the above example.
66.Pp 66.Pp
67The trailing section of a reason code (after the "_R_") is translated 67The 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.
76Although a library will normally report errors using its own specific 76Although a library will normally report errors using its own specific
77.Fn XXXerr 77.Fn XXXerr
78macro, another library's macro can be used. 78macro, another library's macro can be used.
79This is normally only done when a library wants to include ASN1 code 79This is normally only done when a library wants to include ASN.1 code
80which must use the 80which must use the
81.Fn ASN1err 81.Fn ASN1err
82macro. 82macro.
@@ -137,8 +137,8 @@ extern "C" {
137The 137The
138.Sy BEGIN ERROR CODES 138.Sy BEGIN ERROR CODES
139sequence is used by the error code generation script as the point to 139sequence is used by the error code generation script as the point to
140place new error codes, any text after this point will be overwritten 140place new error codes.
141when 141Any text after this point will be overwritten when
142.Sy make errors 142.Sy make errors
143is run. 143is run.
144The closing #endif etc. will be automatically added by the script. 144The closing #endif etc. will be automatically added by the script.
@@ -161,12 +161,12 @@ insertion script
161explicitly to add codes to the header file and generate the C error code 161explicitly to add codes to the header file and generate the C error code
162file. 162file.
163This will normally be done if the external library needs to generate new 163This will normally be done if the external library needs to generate new
164ASN1 structures but it can also be used to add more general purpose 164ASN.1 structures but it can also be used to add more general purpose
165error code handling. 165error code handling.
166.Sh INTERNALS 166.Sh INTERNALS
167The error queues are stored in a hash table with one 167The error queues are stored in a hash table with one
168.Vt ERR_STATE 168.Vt ERR_STATE
169entry for each pid. 169entry for each PID.
170.Fn ERR_get_state 170.Fn ERR_get_state
171returns the current thread's 171returns the current thread's
172.Vt ERR_STATE . 172.Vt ERR_STATE .
@@ -178,13 +178,12 @@ error codes.
178When more error codes are added, the old ones are overwritten, on the 178When more error codes are added, the old ones are overwritten, on the
179assumption that the most recent errors are most important. 179assumption that the most recent errors are most important.
180.Pp 180.Pp
181Error strings are also stored in hash table. 181Error strings are also stored in a hash table.
182The hash tables can be obtained by calling 182The hash tables can be obtained by calling
183.Fn ERR_get_err_state_table 183.Fn ERR_get_err_state_table
184and 184and
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 ,