#include <systemd/sd-event.h>
sd_event_source_set_prepare()
Event source objects have no preparation callback associated when they are first created with calls such as sd_event_add_io(3), sd_event_add_time(3). Preparation callback functions are supported for all event source types with the exception of those created with sd_event_add_exit(3). Preparation callback functions are dispatched in the order indicated by the event source's priority field, as set with sd_event_source_set_priority(3). Preparation callbacks of disabled event sources (see sd_event_source_set_enabled(3)) are not invoked.
On success, sd_event_source_set_prepare() returns a non-negative integer. On failure, it returns a negative errno-style error code.
Returned errors may indicate the following problems:
-EINVAL
-ESTALE
-ENOMEM
-ECHILD
-EDOM
These APIs are implemented as a shared library, which can be compiled and linked to with the libsystemd pkg-config(1) file.
sd-event(3), sd_event_add_io(3), sd_event_add_time(3), sd_event_add_signal(3), sd_event_add_child(3), sd_event_add_inotify(3), sd_event_add_defer(3), sd_event_source_set_enabled(3), sd_event_source_set_priority(3), sd_event_source_set_userdata(3)