1SD_EVENT_SOURCE_GET_PENDINGs(d3_)event_source_get_penSdDi_nEgVENT_SOURCE_GET_PENDING(3)
2
3
4
6 sd_event_source_get_pending - Determine pending state of event sources
7
9 #include <systemd/sd-event.h>
10
11 int sd_event_source_get_pending(sd_event_source *source);
12
14 sd_event_source_get_pending() may be used to determine whether the
15 event source object specified as source has seen events but has not
16 been dispatched yet (and thus is marked "pending").
17
18 Event source objects initially are not marked pending, when they are
19 created with calls such as sd_event_add_io(3), sd_event_add_time(3),
20 with the exception of those created with sd_event_add_defer(3) which
21 are immediately marked pending, and sd_event_add_exit(3) for which the
22 "pending" concept is not defined. For details see the respective manual
23 pages.
24
25 In each event loop iteration one event source of those marked pending
26 is dispatched, in the order defined by the event source priority, as
27 set with sd_event_source_set_priority(3).
28
29 For I/O event sources, as created with sd_event_add_io(3), the call
30 sd_event_source_get_io_revents(3) may be used to query the type of
31 event pending in more detail.
32
34 On success, sd_event_source_get_pending() returns an integer greater
35 than zero when the event source is marked pending, and zero when the
36 event source is not marked pending. On failure, it returns a negative
37 errno-style error code.
38
39 Errors
40 Returned errors may indicate the following problems:
41
42 -EINVAL
43 source is not a valid pointer to an sd_event_source object.
44
45 -EDOM
46 source refers to an event source object created with
47 sd_event_add_exit(3).
48
49 -ENOMEM
50 Not enough memory.
51
52 -ESTALE
53 The event loop is already terminated.
54
55 -ECHILD
56 The event loop has been created in a different process, library or
57 module instance.
58
60 Functions described here are available as a shared library, which can
61 be compiled against and linked to with the libsystemd pkg-config(1)
62 file.
63
64 The code described here uses getenv(3), which is declared to be not
65 multi-thread-safe. This means that the code calling the functions
66 described here must not call setenv(3) from a parallel thread. It is
67 recommended to only do calls to setenv() from an early phase of the
68 program when no other threads have been started.
69
71 sd-event(3), sd_event_add_io(3), sd_event_add_time(3),
72 sd_event_add_signal(3), sd_event_add_child(3), sd_event_add_inotify(3),
73 sd_event_add_defer(3), sd_event_source_unref(3)
74
75
76
77systemd 254 SD_EVENT_SOURCE_GET_PENDING(3)