1gensio_set_read_callback_enaLbilber(a3r)y FunctionsgMeannsuiaol_set_read_callback_enable(3)
2
3
4
6 gensio_set_read_callback_enable, gensio_set_write_callback_enable - En‐
7 able or disable read data and write ready
8
10 #include <gensio/gensio.h>
11
12 void gensio_set_read_callback_enable(struct gensio *io,
13 bool enabled);
14
15 void gensio_set_write_callback_enable(struct gensio *io,
16 bool enabled);
17
19 These function enable the write callback, or the read callback, for
20 gensios (and all child gensios). Generally disabling the read callback
21 will disable all callbacks except write because it won't receive any
22 data to do any processing.
23
24 After you open a gensio or receive a gensio from an accepter, the gen‐
25 sio has all the enables set to false. You would generally want to en‐
26 able the read callback and leave it enabled as much as possible so that
27 low-level processing will happen on the gensio. In particular, dis‐
28 abling read on a UDP gensio will disable all read an accept processing.
29
30 Enabling the write callback will enable the callback to tell you if the
31 gensio can currently write any data. You normally want to leave this
32 disabled and enable it if you write data and get a partial write. Or
33 even better, when you have data to write, enable the write callback and
34 write the data from the callback, disabling when it is all written.
35
36 Disabling the write callback does not necessarily keep data from being
37 transmitted by the gensio. The SSL gensio, for instance, may transmit
38 key information on a rekey, or other gensios may transmit flow-control
39 information. This only affects the write callback.
40
41 Disabling the callbacks may not be immediate. "Immediate" is hard to
42 define in a SMP system, anyway. There may be callbacks running or
43 about to be called when you disable the callback, they may still run.
44 You must be prepared to handle these race conditions.
45
47 Zero is returned on success, or a gensio error on failure.
48
50 gensio_err(3), gensio(5)
51
52
53
54 27 Feb 2019gensio_set_read_callback_enable(3)