summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/BIO_s_fd.345
-rw-r--r--src/lib/libcrypto/man/BIO_s_socket.347
2 files changed, 32 insertions, 60 deletions
diff --git a/src/lib/libcrypto/man/BIO_s_fd.3 b/src/lib/libcrypto/man/BIO_s_fd.3
index 004126565e..591b25d2f2 100644
--- a/src/lib/libcrypto/man/BIO_s_fd.3
+++ b/src/lib/libcrypto/man/BIO_s_fd.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BIO_s_fd.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: BIO_s_fd.3,v 1.3 2016/11/06 16:43:53 schwarze Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 6 2016 $
4.Dt BIO_S_FD 3 4.Dt BIO_S_FD 3
@@ -15,8 +15,17 @@
15.Fo BIO_s_fd 15.Fo BIO_s_fd
16.Fa "void" 16.Fa "void"
17.Fc 17.Fc
18.Fd #define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) 18.Ft long
19.Fd #define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) 19.Fo BIO_set_fd
20.Fa "BIO *b"
21.Fa "int fd"
22.Fa "long close_flag"
23.Fc
24.Ft long
25.Fo BIO_get_fd
26.Fa "BIO *b"
27.Fa "int *c"
28.Fc
20.Ft BIO * 29.Ft BIO *
21.Fo BIO_new_fd 30.Fo BIO_new_fd
22.Fa "int fd" 31.Fa "int fd"
@@ -41,7 +50,9 @@ is not.
41.Pp 50.Pp
42If the close flag is set, 51If the close flag is set,
43.Xr close 2 52.Xr close 2
44is called on the underlying file descriptor when the BIO is freed. 53is called on the underlying file descriptor when the
54.Vt BIO
55is freed.
45.Pp 56.Pp
46.Xr BIO_reset 3 57.Xr BIO_reset 3
47attempts to set the file pointer to the start of the file using 58attempts to set the file pointer to the start of the file using
@@ -58,25 +69,22 @@ returns the current file position by calling
58.Fn lseek fd 0 1 . 69.Fn lseek fd 0 1 .
59.Pp 70.Pp
60.Fn BIO_set_fd 71.Fn BIO_set_fd
61sets the file descriptor of BIO 72sets the file descriptor of
73.Vt BIO
62.Fa b 74.Fa b
63to 75to
64.Fa fd 76.Fa fd
65and the close flag to 77and the close flag to
66.Fa c . 78.Fa close_flag .
79It is currently implemented as a macro.
67.Pp 80.Pp
68.Fn BIO_get_fd 81.Fn BIO_get_fd
69places the file descriptor in 82places the file descriptor in
70.Fa c 83.Fa c
71if it is not 84if it is not
72.Dv NULL , 85.Dv NULL
73it also returns the file descriptor. 86and also returns the file descriptor.
74If 87It is currently implemented as a macro.
75.Fa c
76is not
77.Dv NULL ,
78it should be of type
79.Vt "int *" .
80.Pp 88.Pp
81.Fn BIO_new_fd 89.Fn BIO_new_fd
82returns a file descriptor BIO using 90returns a file descriptor BIO using
@@ -120,10 +128,14 @@ behaviour.
120always returns 1. 128always returns 1.
121.Pp 129.Pp
122.Fn BIO_get_fd 130.Fn BIO_get_fd
123returns the file descriptor or -1 if the BIO has not been initialized. 131returns the file descriptor or -1 if the
132.Vt BIO
133has not been initialized.
124.Pp 134.Pp
125.Fn BIO_new_fd 135.Fn BIO_new_fd
126returns the newly allocated BIO or 136returns the newly allocated
137.Vt BIO
138or
127.Dv NULL 139.Dv NULL
128if an error occurred. 140if an error occurred.
129.Sh EXAMPLES 141.Sh EXAMPLES
@@ -136,4 +148,5 @@ BIO_free(out);
136.Ed 148.Ed
137.Sh SEE ALSO 149.Sh SEE ALSO
138.Xr BIO_read 3 , 150.Xr BIO_read 3 ,
151.Xr BIO_s_socket 3 ,
139.Xr BIO_seek 3 152.Xr BIO_seek 3
diff --git a/src/lib/libcrypto/man/BIO_s_socket.3 b/src/lib/libcrypto/man/BIO_s_socket.3
index 69768bc003..8cc0243066 100644
--- a/src/lib/libcrypto/man/BIO_s_socket.3
+++ b/src/lib/libcrypto/man/BIO_s_socket.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BIO_s_socket.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: BIO_s_socket.3,v 1.3 2016/11/06 16:43:53 schwarze Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 6 2016 $
4.Dt BIO_S_SOCKET 3 4.Dt BIO_S_SOCKET 3
@@ -13,17 +13,6 @@
13.Fo BIO_s_socket 13.Fo BIO_s_socket
14.Fa void 14.Fa void
15.Fc 15.Fc
16.Ft long
17.Fo BIO_set_fd
18.Fa "BIO *b"
19.Fa "int fd"
20.Fa "long close_flag"
21.Fc
22.Ft long
23.Fo BIO_get_fd
24.Fa "BIO *b"
25.Fa "int *c"
26.Fc
27.Ft BIO * 16.Ft BIO *
28.Fo BIO_new_socket 17.Fo BIO_new_socket
29.Fa "int sock" 18.Fa "int sock"
@@ -46,27 +35,6 @@ is not.
46If the close flag is set, then the socket is shut down and closed 35If the close flag is set, then the socket is shut down and closed
47when the BIO is freed. 36when the BIO is freed.
48.Pp 37.Pp
49.Fn BIO_set_fd
50sets the socket of BIO
51.Fa b
52to
53.Fa fd
54and the close flag to
55.Fa close_flag .
56.Pp
57.Fn BIO_get_fd
58places the socket in
59.Fa c
60if it is not
61.Dv NULL ,
62it also returns the socket.
63If
64.Fa c
65is not
66.Dv NULL
67it should be of type
68.Vt "int *" .
69.Pp
70.Fn BIO_new_socket 38.Fn BIO_new_socket
71returns a socket BIO using 39returns a socket BIO using
72.Fa sock 40.Fa sock
@@ -80,22 +48,13 @@ is that on some platforms, sockets are not file descriptors
80and use distinct I/O routines. 48and use distinct I/O routines.
81Windows is one such platform. 49Windows is one such platform.
82Any code mixing the two will not work on all platforms. 50Any code mixing the two will not work on all platforms.
83.Pp
84.Fn BIO_set_fd
85and
86.Fn BIO_get_fd
87are macros.
88.Sh RETURN VALUES 51.Sh RETURN VALUES
89.Fn BIO_s_socket 52.Fn BIO_s_socket
90returns the socket BIO method. 53returns the socket BIO method.
91.Pp 54.Pp
92.Fn BIO_set_fd
93always returns 1.
94.Pp
95.Fn BIO_get_fd
96returns the socket or -1 if the BIO has not been initialized.
97.Pp
98.Fn BIO_new_socket 55.Fn BIO_new_socket
99returns the newly allocated BIO or 56returns the newly allocated BIO or
100.Dv NULL 57.Dv NULL
101if an error occurred. 58if an error occurred.
59.Sh SEE ALSO
60.Xr BIO_get_fd 3