diff options
author | schwarze <> | 2022-12-20 14:55:45 +0000 |
---|---|---|
committer | schwarze <> | 2022-12-20 14:55:45 +0000 |
commit | e2e6a9b4f3e79d199be299c9277b0796aa86c6d3 (patch) | |
tree | 0573d18673f9006550b6cc0515b229e47e2f452b /src | |
parent | 613a18d3bc1ef0bcd786465088786fd3b0b14f88 (diff) | |
download | openbsd-e2e6a9b4f3e79d199be299c9277b0796aa86c6d3.tar.gz openbsd-e2e6a9b4f3e79d199be299c9277b0796aa86c6d3.tar.bz2 openbsd-e2e6a9b4f3e79d199be299c9277b0796aa86c6d3.zip |
document BIO_fd_non_fatal_error(3) and BIO_fd_should_retry(3)
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/BIO_s_fd.3 | 84 |
1 files changed, 76 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/BIO_s_fd.3 b/src/lib/libcrypto/man/BIO_s_fd.3 index 5ac33e77ee..a22ba5d603 100644 --- a/src/lib/libcrypto/man/BIO_s_fd.3 +++ b/src/lib/libcrypto/man/BIO_s_fd.3 | |||
@@ -1,7 +1,24 @@ | |||
1 | .\" $OpenBSD: BIO_s_fd.3,v 1.9 2018/05/01 17:05:05 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_s_fd.3,v 1.10 2022/12/20 14:55:45 schwarze Exp $ |
2 | .\" OpenSSL 9b86974e Aug 17 15:21:33 2015 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | 4 | .\" This file is a derived work. |
5 | .\" The changes are covered by the following Copyright and license: | ||
6 | .\" | ||
7 | .\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org> | ||
8 | .\" | ||
9 | .\" Permission to use, copy, modify, and distribute this software for any | ||
10 | .\" purpose with or without fee is hereby granted, provided that the above | ||
11 | .\" copyright notice and this permission notice appear in all copies. | ||
12 | .\" | ||
13 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
14 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
15 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
16 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
17 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
20 | .\" | ||
21 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. | 22 | .\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. |
6 | .\" | 23 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 24 | .\" Redistribution and use in source and binary forms, with or without |
@@ -48,14 +65,16 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 67 | .\" |
51 | .Dd $Mdocdate: May 1 2018 $ | 68 | .Dd $Mdocdate: December 20 2022 $ |
52 | .Dt BIO_S_FD 3 | 69 | .Dt BIO_S_FD 3 |
53 | .Os | 70 | .Os |
54 | .Sh NAME | 71 | .Sh NAME |
55 | .Nm BIO_s_fd , | 72 | .Nm BIO_s_fd , |
56 | .Nm BIO_set_fd , | 73 | .Nm BIO_set_fd , |
57 | .Nm BIO_get_fd , | 74 | .Nm BIO_get_fd , |
58 | .Nm BIO_new_fd | 75 | .Nm BIO_new_fd , |
76 | .Nm BIO_fd_non_fatal_error , | ||
77 | .Nm BIO_fd_should_retry | ||
59 | .Nd file descriptor BIO | 78 | .Nd file descriptor BIO |
60 | .Sh SYNOPSIS | 79 | .Sh SYNOPSIS |
61 | .In openssl/bio.h | 80 | .In openssl/bio.h |
@@ -79,6 +98,10 @@ | |||
79 | .Fa "int fd" | 98 | .Fa "int fd" |
80 | .Fa "int close_flag" | 99 | .Fa "int close_flag" |
81 | .Fc | 100 | .Fc |
101 | .Ft int | ||
102 | .Fn BIO_fd_non_fatal_error "int errnum" | ||
103 | .Ft int | ||
104 | .Fn BIO_fd_should_retry "int retval" | ||
82 | .Sh DESCRIPTION | 105 | .Sh DESCRIPTION |
83 | .Fn BIO_s_fd | 106 | .Fn BIO_s_fd |
84 | returns the file descriptor BIO method. | 107 | returns the file descriptor BIO method. |
@@ -140,6 +163,25 @@ returns a file descriptor BIO using | |||
140 | and | 163 | and |
141 | .Fa close_flag . | 164 | .Fa close_flag . |
142 | .Pp | 165 | .Pp |
166 | .Fn BIO_fd_non_fatal_error | ||
167 | determines whether the error status code | ||
168 | .Fa errnum | ||
169 | represents a recoverable error. | ||
170 | .Fn BIO_fd_should_retry | ||
171 | determines whether a recoverable error occurred by inspecting both | ||
172 | .Xr errno 2 | ||
173 | and | ||
174 | .Fa retval , | ||
175 | which is supposed to usually be | ||
176 | the return value of a previously called function like | ||
177 | .Xr BIO_read 3 | ||
178 | or | ||
179 | .Xr BIO_write 3 . | ||
180 | These two functions are mostly used internally; in application code, | ||
181 | it is usually easier and more robust to use | ||
182 | .Xr BIO_should_retry 3 , | ||
183 | which works for any BIO type. | ||
184 | .Pp | ||
143 | The behaviour of | 185 | The behaviour of |
144 | .Xr BIO_read 3 | 186 | .Xr BIO_read 3 |
145 | and | 187 | and |
@@ -181,6 +223,27 @@ returns the newly allocated | |||
181 | or | 223 | or |
182 | .Dv NULL | 224 | .Dv NULL |
183 | if an error occurred. | 225 | if an error occurred. |
226 | .Pp | ||
227 | .Fn BIO_fd_non_fatal_error | ||
228 | returns 1 if | ||
229 | .Fa errnum | ||
230 | is | ||
231 | .Dv EAGAIN , | ||
232 | .Dv EALREADY , | ||
233 | .Dv EINPROGRESS , | ||
234 | .Dv EINTR , | ||
235 | or | ||
236 | .Dv ENOTCONN | ||
237 | and 0 otherwise, even if | ||
238 | .Fa errnum | ||
239 | is 0. | ||
240 | .Pp | ||
241 | .Fn BIO_fd_should_retry | ||
242 | returns 1 if | ||
243 | .Fn BIO_fd_non_fatal_error errno | ||
244 | is 1 and | ||
245 | .Fa retval | ||
246 | is either 0 or \-1, or 0 otherwise. | ||
184 | .Sh EXAMPLES | 247 | .Sh EXAMPLES |
185 | This is a file descriptor BIO version of "Hello World": | 248 | This is a file descriptor BIO version of "Hello World": |
186 | .Bd -literal -offset indent | 249 | .Bd -literal -offset indent |
@@ -193,14 +256,19 @@ BIO_free(out); | |||
193 | .Xr BIO_new 3 , | 256 | .Xr BIO_new 3 , |
194 | .Xr BIO_read 3 , | 257 | .Xr BIO_read 3 , |
195 | .Xr BIO_s_socket 3 , | 258 | .Xr BIO_s_socket 3 , |
196 | .Xr BIO_seek 3 | 259 | .Xr BIO_seek 3 , |
260 | .Xr BIO_should_retry 3 | ||
197 | .Sh HISTORY | 261 | .Sh HISTORY |
198 | .Fn BIO_s_fd , | 262 | .Fn BIO_s_fd , |
199 | .Fn BIO_set_fd , | 263 | .Fn BIO_set_fd , |
200 | and | 264 | and |
201 | .Fn BIO_get_fd | 265 | .Fn BIO_get_fd |
202 | first appeared in SSLeay 0.6.0. | 266 | first appeared in SSLeay 0.6.0, |
267 | .Fn BIO_fd_should_retry | ||
268 | in SSLeay 0.6.5, and | ||
203 | .Fn BIO_new_fd | 269 | .Fn BIO_new_fd |
204 | first appeared in SSLeay 0.8.0. | 270 | and |
271 | .Fn BIO_fd_non_fatal_error | ||
272 | in SSLeay 0.8.0. | ||
205 | All these functions have been available since | 273 | All these functions have been available since |
206 | .Ox 2.4 . | 274 | .Ox 2.4 . |