summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BIO_s_socket.3
diff options
context:
space:
mode:
authorschwarze <>2015-02-16 16:42:14 +0000
committerschwarze <>2015-02-16 16:42:14 +0000
commit9a3026fb0a89a15ea2def3629cc13a69f1fc678c (patch)
tree28ac935f3dd22b133413a78861848f9501389a34 /src/lib/libcrypto/man/BIO_s_socket.3
parent4ab59c54f9da1075f740a1004c326b0784ed4de0 (diff)
downloadopenbsd-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.399
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
32returns the socket BIO method.
33This is a wrapper around the platform's socket routines.
34.Pp
35.Xr BIO_read 3
36and
37.Xr BIO_write 3
38read or write the underlying socket.
39.Xr BIO_puts 3
40is supported but
41.Xr BIO_gets 3
42is not.
43.Pp
44If the close flag is set, then the socket is shut down and closed
45when the BIO is freed.
46.Pp
47.Fn BIO_set_fd
48sets the socket of BIO
49.Fa b
50to
51.Fa fd
52and the close flag to
53.Fa close_flag .
54.Pp
55.Fn BIO_get_fd
56places the socket in
57.Fa c
58if it is not
59.Dv NULL ,
60it also returns the socket.
61If
62.Fa c
63is not
64.Dv NULL
65it should be of type
66.Vt "int *" .
67.Pp
68.Fn BIO_new_socket
69returns a socket BIO using
70.Fa sock
71and
72.Fa close_flag .
73.Sh NOTES
74Socket BIOs also support any relevant functionality of file descriptor BIOs.
75.Pp
76The reason for having separate file descriptor and socket BIOs
77is that on some platforms, sockets are not file descriptors
78and use distinct I/O routines.
79Windows is one such platform.
80Any code mixing the two will not work on all platforms.
81.Pp
82.Fn BIO_set_fd
83and
84.Fn BIO_get_fd
85are macros.
86.Sh RETURN VALUES
87.Fn BIO_s_socket
88returns the socket BIO method.
89.Pp
90.Fn BIO_set_fd
91always returns 1.
92.Pp
93.Fn BIO_get_fd
94returns the socket or -1 if the BIO has not been initialized.
95.Pp
96.Fn BIO_new_socket
97returns the newly allocated BIO or
98.Dv NULL
99if an error occurred.