diff options
author | schwarze <> | 2022-12-18 17:40:55 +0000 |
---|---|---|
committer | schwarze <> | 2022-12-18 17:40:55 +0000 |
commit | d07f9488e474637d5944d7d73e5db19f1680f554 (patch) | |
tree | 6ddac0c52ff6e44596dfccd09803db3bd9520a64 /src | |
parent | 9120cbac04bd757c024a3d0a0cfbaf9ce8e79e96 (diff) | |
download | openbsd-d07f9488e474637d5944d7d73e5db19f1680f554.tar.gz openbsd-d07f9488e474637d5944d7d73e5db19f1680f554.tar.bz2 openbsd-d07f9488e474637d5944d7d73e5db19f1680f554.zip |
document BIO_number_read(3) and BIO_number_written(3)
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/BIO_read.3 | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/BIO_read.3 b/src/lib/libcrypto/man/BIO_read.3 index ac809bc782..5fea9f728a 100644 --- a/src/lib/libcrypto/man/BIO_read.3 +++ b/src/lib/libcrypto/man/BIO_read.3 | |||
@@ -1,10 +1,10 @@ | |||
1 | .\" $OpenBSD: BIO_read.3,v 1.10 2021/12/08 16:31:10 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_read.3,v 1.11 2022/12/18 17:40:55 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
5 | .\" The changes are covered by the following Copyright and license: | 5 | .\" The changes are covered by the following Copyright and license: |
6 | .\" | 6 | .\" |
7 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 7 | .\" Copyright (c) 2021, 2022 Ingo Schwarze <schwarze@openbsd.org> |
8 | .\" | 8 | .\" |
9 | .\" Permission to use, copy, modify, and distribute this software for any | 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 | 10 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -65,15 +65,17 @@ | |||
65 | .\" 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 |
66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
67 | .\" | 67 | .\" |
68 | .Dd $Mdocdate: December 8 2021 $ | 68 | .Dd $Mdocdate: December 18 2022 $ |
69 | .Dt BIO_READ 3 | 69 | .Dt BIO_READ 3 |
70 | .Os | 70 | .Os |
71 | .Sh NAME | 71 | .Sh NAME |
72 | .Nm BIO_read , | 72 | .Nm BIO_read , |
73 | .Nm BIO_number_read , | ||
73 | .Nm BIO_gets , | 74 | .Nm BIO_gets , |
74 | .Nm BIO_write , | 75 | .Nm BIO_write , |
75 | .Nm BIO_puts , | 76 | .Nm BIO_puts , |
76 | .Nm BIO_indent | 77 | .Nm BIO_indent , |
78 | .Nm BIO_number_written | ||
77 | .Nd BIO I/O functions | 79 | .Nd BIO I/O functions |
78 | .Sh SYNOPSIS | 80 | .Sh SYNOPSIS |
79 | .In openssl/bio.h | 81 | .In openssl/bio.h |
@@ -83,6 +85,10 @@ | |||
83 | .Fa "void *buf" | 85 | .Fa "void *buf" |
84 | .Fa "int len" | 86 | .Fa "int len" |
85 | .Fc | 87 | .Fc |
88 | .Ft unsigned long | ||
89 | .Fo BIO_number_read | ||
90 | .Fa "BIO *b" | ||
91 | .Fc | ||
86 | .Ft int | 92 | .Ft int |
87 | .Fo BIO_gets | 93 | .Fo BIO_gets |
88 | .Fa "BIO *b" | 94 | .Fa "BIO *b" |
@@ -106,6 +112,10 @@ | |||
106 | .Fa "int indent" | 112 | .Fa "int indent" |
107 | .Fa "int max" | 113 | .Fa "int max" |
108 | .Fc | 114 | .Fc |
115 | .Ft unsigned long | ||
116 | .Fo BIO_number_written | ||
117 | .Fa "BIO *b" | ||
118 | .Fc | ||
109 | .Sh DESCRIPTION | 119 | .Sh DESCRIPTION |
110 | .Fn BIO_read | 120 | .Fn BIO_read |
111 | attempts to read | 121 | attempts to read |
@@ -115,6 +125,26 @@ bytes from | |||
115 | and places the data in | 125 | and places the data in |
116 | .Fa buf . | 126 | .Fa buf . |
117 | .Pp | 127 | .Pp |
128 | .Fn BIO_number_read | ||
129 | returns the grand total of bytes read from | ||
130 | .Fa b | ||
131 | using | ||
132 | .Fn BIO_read | ||
133 | so far. | ||
134 | Bytes read with | ||
135 | .Fn BIO_gets | ||
136 | do | ||
137 | .Sy not | ||
138 | count. | ||
139 | .Xr BIO_new 3 | ||
140 | and | ||
141 | .Xr BIO_set 3 | ||
142 | initialize the counter to 0. | ||
143 | When reading very large amounts of data, | ||
144 | the counter will eventually wrap around from | ||
145 | .Dv ULONG_MAX | ||
146 | to 0. | ||
147 | .Pp | ||
118 | .Fn BIO_gets | 148 | .Fn BIO_gets |
119 | performs the BIOs "gets" operation and places the data in | 149 | performs the BIOs "gets" operation and places the data in |
120 | .Fa buf . | 150 | .Fa buf . |
@@ -152,6 +182,24 @@ but not more than | |||
152 | .Fa max | 182 | .Fa max |
153 | characters. | 183 | characters. |
154 | .Pp | 184 | .Pp |
185 | .Fn BIO_number_written | ||
186 | returns the grand total of bytes written to | ||
187 | .Fa b | ||
188 | using | ||
189 | .Fn BIO_write , | ||
190 | .Fn BIO_puts , | ||
191 | and | ||
192 | .Fn BIO_indent | ||
193 | so far. | ||
194 | .Xr BIO_new 3 | ||
195 | and | ||
196 | .Xr BIO_set 3 | ||
197 | initialize the counter to 0. | ||
198 | When writing very large amounts of data, | ||
199 | the counter will eventually wrap around from | ||
200 | .Dv ULONG_MAX | ||
201 | to 0. | ||
202 | .Pp | ||
155 | One technique sometimes used with blocking sockets | 203 | One technique sometimes used with blocking sockets |
156 | is to use a system call (such as | 204 | is to use a system call (such as |
157 | .Xr select 2 , | 205 | .Xr select 2 , |
@@ -189,6 +237,15 @@ to the chain. | |||
189 | returns 1 if successful, even if nothing was written, | 237 | returns 1 if successful, even if nothing was written, |
190 | or 0 if writing fails. | 238 | or 0 if writing fails. |
191 | .Pp | 239 | .Pp |
240 | .Fn BIO_number_read | ||
241 | and | ||
242 | .Fn BIO_number_written | ||
243 | return a number of bytes or 0 if | ||
244 | .Fa b | ||
245 | is a | ||
246 | .Dv NULL | ||
247 | pointer. | ||
248 | .Pp | ||
192 | The other functions return either the amount of data successfully | 249 | The other functions return either the amount of data successfully |
193 | read or written (if the return value is positive) or that no data | 250 | read or written (if the return value is positive) or that no data |
194 | was successfully read or written if the result is 0 or \-1. | 251 | was successfully read or written if the result is 0 or \-1. |
@@ -211,7 +268,12 @@ the application should retry the operation later. | |||
211 | .Fn BIO_write , | 268 | .Fn BIO_write , |
212 | and | 269 | and |
213 | .Fn BIO_puts | 270 | .Fn BIO_puts |
214 | first appeared in SSLeay 0.6.0 and have been available since | 271 | first appeared in SSLeay 0.6.0. |
272 | .Fn BIO_number_read | ||
273 | and | ||
274 | .Fn BIO_number_written | ||
275 | first appeared in SSLeay 0.6.5. | ||
276 | These functions have been available since | ||
215 | .Ox 2.4 . | 277 | .Ox 2.4 . |
216 | .Pp | 278 | .Pp |
217 | .Fn BIO_indent | 279 | .Fn BIO_indent |