1gensio_acc_accept_s(3) Library Functions Manual gensio_acc_accept_s(3)
2
3
4
6 gensio_acc_set_sync, gensio_acc_accept_s, gensio_acc_accept_s_intr -
7 Synchronous I/O operations on a gensio accepter
8
10 #include <gensio/gensio.h>
11
12 int gensio_acc_set_sync(struct gensio_accepter *acc);
13
14 int gensio_acc_accept_s(struct gensio_accepter *acc,
15 struct gensio_time *timeout,
16 struct gensio **new_io);
17
18 int gensio_acc_accept_s_intr(struct gensio_accepter *acc,
19 struct gensio_time *timeout,
20 struct gensio **new_io);
21
23 Normal gensio accepter operation is asynchronous callback based. This
24 serves most programs fairly well, especially if they need to handle
25 multiple accepts on the same or different accepters.
26
27 But occasionally you need to do something synchronous with the program
28 execution, especially if you have a simple program that just accepts
29 one connection and then does something.
30
31 gensio_acc set_sync sets up the gensio accepter for synchronous ac‐
32 cepts. If you do this, the event callback that is currently registered
33 will no longer receive new connection events. It *will* receive other
34 callbacks. You must call this before starting up the gensio accepter,
35 and once you call it the gensio accepter is in sync mode until you shut
36 it down.
37
38 gensio_accept_s Waits for an incoming connection on the gensio ac‐
39 cepter. This function waits for the amount of time in timeout. time‐
40 out is updated to the amount of time left to wait. If timeout is NULL,
41 wait forever. If no error is returned, the new incoming connection is
42 returned in new_io.
43
44 gensio_accept_s_intr is like gensio_accept_s, but it return immediately
45 if an signal interrupt occurs. On systems without signals, this is the
46 same as gensio_accept_s.
47
49 Zero is returned on success, or a gensio error on failure.
50
52 gensio_err(3), gensio_set_sync(3), gensio(5)
53
54
55
56 27 Jan 2020 gensio_acc_accept_s(3)