summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/BIO_s_fd.384
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
84returns the file descriptor BIO method. 107returns the file descriptor BIO method.
@@ -140,6 +163,25 @@ returns a file descriptor BIO using
140and 163and
141.Fa close_flag . 164.Fa close_flag .
142.Pp 165.Pp
166.Fn BIO_fd_non_fatal_error
167determines whether the error status code
168.Fa errnum
169represents a recoverable error.
170.Fn BIO_fd_should_retry
171determines whether a recoverable error occurred by inspecting both
172.Xr errno 2
173and
174.Fa retval ,
175which is supposed to usually be
176the return value of a previously called function like
177.Xr BIO_read 3
178or
179.Xr BIO_write 3 .
180These two functions are mostly used internally; in application code,
181it is usually easier and more robust to use
182.Xr BIO_should_retry 3 ,
183which works for any BIO type.
184.Pp
143The behaviour of 185The behaviour of
144.Xr BIO_read 3 186.Xr BIO_read 3
145and 187and
@@ -181,6 +223,27 @@ returns the newly allocated
181or 223or
182.Dv NULL 224.Dv NULL
183if an error occurred. 225if an error occurred.
226.Pp
227.Fn BIO_fd_non_fatal_error
228returns 1 if
229.Fa errnum
230is
231.Dv EAGAIN ,
232.Dv EALREADY ,
233.Dv EINPROGRESS ,
234.Dv EINTR ,
235or
236.Dv ENOTCONN
237and 0 otherwise, even if
238.Fa errnum
239is 0.
240.Pp
241.Fn BIO_fd_should_retry
242returns 1 if
243.Fn BIO_fd_non_fatal_error errno
244is 1 and
245.Fa retval
246is either 0 or \-1, or 0 otherwise.
184.Sh EXAMPLES 247.Sh EXAMPLES
185This is a file descriptor BIO version of "Hello World": 248This 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 ,
200and 264and
201.Fn BIO_get_fd 265.Fn BIO_get_fd
202first appeared in SSLeay 0.6.0. 266first appeared in SSLeay 0.6.0,
267.Fn BIO_fd_should_retry
268in SSLeay 0.6.5, and
203.Fn BIO_new_fd 269.Fn BIO_new_fd
204first appeared in SSLeay 0.8.0. 270and
271.Fn BIO_fd_non_fatal_error
272in SSLeay 0.8.0.
205All these functions have been available since 273All these functions have been available since
206.Ox 2.4 . 274.Ox 2.4 .