diff options
author | schwarze <> | 2015-02-16 16:42:14 +0000 |
---|---|---|
committer | schwarze <> | 2015-02-16 16:42:14 +0000 |
commit | 9a3026fb0a89a15ea2def3629cc13a69f1fc678c (patch) | |
tree | 28ac935f3dd22b133413a78861848f9501389a34 /src/lib/libcrypto/man/BIO_s_socket.3 | |
parent | 4ab59c54f9da1075f740a1004c326b0784ed4de0 (diff) | |
download | openbsd-9a3026fb0a89a15ea2def3629cc13a69f1fc678c.tar.gz openbsd-9a3026fb0a89a15ea2def3629cc13a69f1fc678c.tar.bz2 openbsd-9a3026fb0a89a15ea2def3629cc13a69f1fc678c.zip |
third batch of perlpod(1) to mdoc(7) conversion
Diffstat (limited to 'src/lib/libcrypto/man/BIO_s_socket.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_s_socket.3 | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BIO_s_socket.3 b/src/lib/libcrypto/man/BIO_s_socket.3 new file mode 100644 index 0000000000..f7aff6a4c8 --- /dev/null +++ b/src/lib/libcrypto/man/BIO_s_socket.3 | |||
@@ -0,0 +1,99 @@ | |||
1 | .Dd $Mdocdate: February 16 2015 $ | ||
2 | .Dt BIO_S_SOCKET 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BIO_s_socket , | ||
6 | .Nm BIO_new_socket | ||
7 | .Nd socket BIO | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/bio.h | ||
10 | .Ft BIO_METHOD * | ||
11 | .Fo BIO_s_socket | ||
12 | .Fa void | ||
13 | .Fc | ||
14 | .Ft long | ||
15 | .Fo BIO_set_fd | ||
16 | .Fa "BIO *b" | ||
17 | .Fa "int fd" | ||
18 | .Fa "long close_flag" | ||
19 | .Fc | ||
20 | .Ft long | ||
21 | .Fo BIO_get_fd | ||
22 | .Fa "BIO *b" | ||
23 | .Fa "int *c" | ||
24 | .Fc | ||
25 | .Ft BIO * | ||
26 | .Fo BIO_new_socket | ||
27 | .Fa "int sock" | ||
28 | .Fa "int close_flag" | ||
29 | .Fc | ||
30 | .Sh DESCRIPTION | ||
31 | .Fn BIO_s_socket | ||
32 | returns the socket BIO method. | ||
33 | This is a wrapper around the platform's socket routines. | ||
34 | .Pp | ||
35 | .Xr BIO_read 3 | ||
36 | and | ||
37 | .Xr BIO_write 3 | ||
38 | read or write the underlying socket. | ||
39 | .Xr BIO_puts 3 | ||
40 | is supported but | ||
41 | .Xr BIO_gets 3 | ||
42 | is not. | ||
43 | .Pp | ||
44 | If the close flag is set, then the socket is shut down and closed | ||
45 | when the BIO is freed. | ||
46 | .Pp | ||
47 | .Fn BIO_set_fd | ||
48 | sets the socket of BIO | ||
49 | .Fa b | ||
50 | to | ||
51 | .Fa fd | ||
52 | and the close flag to | ||
53 | .Fa close_flag . | ||
54 | .Pp | ||
55 | .Fn BIO_get_fd | ||
56 | places the socket in | ||
57 | .Fa c | ||
58 | if it is not | ||
59 | .Dv NULL , | ||
60 | it also returns the socket. | ||
61 | If | ||
62 | .Fa c | ||
63 | is not | ||
64 | .Dv NULL | ||
65 | it should be of type | ||
66 | .Vt "int *" . | ||
67 | .Pp | ||
68 | .Fn BIO_new_socket | ||
69 | returns a socket BIO using | ||
70 | .Fa sock | ||
71 | and | ||
72 | .Fa close_flag . | ||
73 | .Sh NOTES | ||
74 | Socket BIOs also support any relevant functionality of file descriptor BIOs. | ||
75 | .Pp | ||
76 | The reason for having separate file descriptor and socket BIOs | ||
77 | is that on some platforms, sockets are not file descriptors | ||
78 | and use distinct I/O routines. | ||
79 | Windows is one such platform. | ||
80 | Any code mixing the two will not work on all platforms. | ||
81 | .Pp | ||
82 | .Fn BIO_set_fd | ||
83 | and | ||
84 | .Fn BIO_get_fd | ||
85 | are macros. | ||
86 | .Sh RETURN VALUES | ||
87 | .Fn BIO_s_socket | ||
88 | returns the socket BIO method. | ||
89 | .Pp | ||
90 | .Fn BIO_set_fd | ||
91 | always returns 1. | ||
92 | .Pp | ||
93 | .Fn BIO_get_fd | ||
94 | returns the socket or -1 if the BIO has not been initialized. | ||
95 | .Pp | ||
96 | .Fn BIO_new_socket | ||
97 | returns the newly allocated BIO or | ||
98 | .Dv NULL | ||
99 | if an error occurred. | ||